argon2checkhash()

Returns hash of input using Argon2.

Introduced: 5.3.8.43

argon2checkhash( input=string, hash=string, variant=string );

Returns: Boolean

Argument Description Default
input
string, required

Input string.

hash
string, required

Argon2 hash to compare against input string

variant
string, optional

Either Argon2i, Argon2d or Argon2id

argon2i

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