argon2CheckHash

Verify the Argon2 hash of an input.

argon2CheckHash(string, hash [, variant]) → returns boolean

This function requires Lucee 5.3.8 and up.  Not supported on Adobe ColdFusion, etc.

Argument Reference

input string
Required

The string input to test against the hash.

hash string
Required

An Argon2 hash value

variant string
Default: Argon2i

Values:
  • Argon2i
  • Argon2d
  • Argon2id

Links more information about argon2CheckHash

Examples
Sample code invoking the argon2CheckHash function

hashedValue = GenerateArgon2Hash("CFDocs.org");
dump(hashedValue);
check1 = Argon2CheckHash( "CFDocs.org", hashedValue);
dump( check1 );
check2 = Argon2CheckHash( "DifferentInput", hashedValue);
dump( check2 );

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub