Argon2CheckHash()

edit

Verifies a password against an Argon2 hash. For new code, prefer Argon2Verify() for consistent naming.

Status:

deprecated

Requires Extension: Crypto Extension

Argon2CheckHash( input=string, hash=string, throwOnError=boolean );

Returns: Boolean

Argument Description Default
input
string, required
edit

Input string.

hash
string, required
edit

Argon2 hash to compare against input string

throwOnError
boolean, optional
edit

If true, throws an exception on invalid hash format instead of returning false

false

Usage Notes

edit

Originally provided by the Argon2 Extension on Lucee 5.3.8.43+ and 6.x, and now also by the Crypto Extension on Lucee 7+ (which replaces it).

For new code, prefer Argon2Verify() for consistent naming with BCryptVerify() and SCryptVerify().

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