e-CryptIt Engine Xojo Plugin |
|
EinhugurBCrypt.HashTask Method
Creates task object to hash the token / password with a salt that has been generated with the GenerateSalt routine or obtained from external source.
shared HashTask(
token
as String,
salt
as String)
as EinhugurRuntime.Task
Parameters
- token
- The token or password to hash.
- salt
- The salt to use, generated with the GenerateSalt function or obtained from external source.
Returns
- EinhugurRuntime.Task
- EinhugurRuntime.Task or nil if there was error.
Remarks
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 salt as String = EinhugurBCrypt.GenerateSalt(15)
var task as EinhugurRuntime.Task = EinhugurBCrypt.HashTask("Some password", salt)
task.WaitFor()
var hash as String = task.StringResult
See Also
EinhugurBCrypt Class