e-CryptIt Engine Xojo Plugin |

# EinhugurBCrypt.Hash Method

Hashes the token / password, taking in number of rounds (cost), so that salt can be generated internally on the fly.

shared Hash(
token as String,
numberOfRounds as Integer=10) as String

#### Parameters

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

#### Returns

String

#### 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.
This function is also offered as long running task with the HashTask function, which is meant for if you have the need for very high work rate without having the hardware to do that in short time.
This function can raise InvalidArgumentException exception.

var hash as string = EinhugurBCrypt.Hash("LazyFox123", 12)

#### See Also

EinhugurBCrypt Class