GenerateArgon2Hash()
Returns hash of input using Argon2.
Introduced: 5.3.8.18
Requires Extension: Argon2 Extension
GenerateArgon2Hash( input=string, variant=string, parallelismFactor=number, memoryCost=number, iterations=number );
Returns: String
| Argument | Description | Default |
|---|---|---|
|
input
string,
required
|
edit
Input string. |
|
|
variant
string,
optional
|
edit
Either Argon2i, Argon2d or Argon2id Introduced: 5.3.8.43 |
argon2i |
|
parallelismFactor
number,
optional
|
edit
Degrees of parallelism, a number between 1 and 10. |
1 |
|
memoryCost
number,
optional
|
edit
A number between 8 and 100000. |
8 |
|
iterations
number,
optional
|
edit
A number between 1 and 20. |
1 |
Examples
edit secret = createUUID();
dump(var=secret, label="input string");
hashed = generateArgon2Hash(secret);
dump(var=hashed, label="generateArgon2Hash");
decoded= argon2checkhash(secret, hashed);
dump(var=decoded, label="argon2checkhash matches");
See also
- Cryptography
- Argon2CheckHash()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)