e-CryptIt Engine Xojo Plugin

EinhugurBCrypt.HashTask Method

Creates task object to hash the token / password, taking in number of rounds (cost), so that salt can be generated internally on the fly.

shared HashTask(
   token as String,
   numberOfRounds as Integer=10) as EinhugurRuntime.Task

Parameters

token
The token or password to hash.
numberOfRounds
Number of rounds (work effort). Default value is 10.

Returns

EinhugurRuntime.Task
EinhugurRuntime.Task or nil if there was error.

Remarks

This cost is also known as the work factor. It is recommended as a common rule of thumb for work factor setting to tune the cost so that the function runs as slow as possible without affecting the users experience and without increasing the need to use additional hardware that may be over budget.

The task version of the function is for if you have to deal with cost rates that are not really fitting for your hardware. Then it can be good to set up such long running task.

This function can raise InvalidArgumentException exception.



var task as EinhugurRuntime.Task = EinhugurBCrypt.HashTask("Some password", 15)

task.WaitFor()

var hash2 as String = task.StringResult

See Also

EinhugurBCrypt Class