-
-
Notifications
You must be signed in to change notification settings - Fork 3
libsodium.Password.GenerateHash
Function GenerateHash(HashAlgorithm As Int32 = libsodium.Password.ALG_ARGON2, Limits As libsodium.ResourceLimits = libsodium.ResourceLimits.Interactive) As MemoryBlock
Name | Type | Comment |
---|---|---|
HashAlgorithm | Int32 | Optional. Either ALG_ARGON2 (default) or ALG_SCRYPT . |
Limits | ResourceLimits | Optional. A member of the ResourceLimits enumeration. |
A fixed-length hash of the password.
This method computes a computationally-intensive salted hash (either Argon2i or scrypt) of the password. The resulting hash value is suitable for storage (e.g. in a database).
The salt is selected at random and is included as part of the output. Use the VerifyHash method to validate a password.
You can fine-tune how resource-intensive the hash operation is by changing the Limits
parameter. The default is Interactive
, which is the least intensive (i.e. suitable for interactive desktop programs.) Beware that this method may fail if the Limits
are so intensive that the system can't or won't satisfy them.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2016-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.