generateArgon2Hash()

Returns hash of input using Argon2.

Introduced: 5.3.8.18

generateArgon2Hash( input=string, variant=string, parallelismFactor=number, memoryCost=number, iterations=number );

Returns: String

Argument Description Default
input
string, required

Input string.

variant
string, optional

Either Argon2i, Argon2d or Argon2id

argon2i

parallelismFactor
number, optional

Degrees of parallelism, a number between 1 and 10.

1

memoryCost
number, optional

A number between 8 and 100000.

8

iterations
number, optional

A number between 1 and 20.

1

Examples

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