Argon2CheckHash()

Returns hash of input using Argon2.

Introduced: 5.3.8.43

Requires Extension: Argon2 Extension

Argon2CheckHash( input=string, hash=string );

Returns: Boolean

Argument Description
input
string, required

Input string.

hash
string, required

Argon2 hash to compare against input string

Examples

secret = createUUID();
    dump(var=secret, label="input string");
<span class="nv">hashed</span> <span class="o">=</span> <span class="nf">generateArgon2Hash</span><span class="p">(</span><span class="nv">secret</span><span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span><span class="k">var</span><span class="o">=</span><span class="nv">hashed</span><span class="p">,</span> <span class="nv">label</span><span class="o">=</span><span class="s2">&quot;generateArgon2Hash&quot;</span><span class="p">);</span>
<span class="nv">decoded</span><span class="o">=</span> <span class="nf">argon2checkhash</span><span class="p">(</span><span class="nv">secret</span><span class="p">,</span> <span class="nv">hashed</span><span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span><span class="k">var</span><span class="o">=</span><span class="nv">decoded</span><span class="p">,</span> <span class="nv">label</span><span class="o">=</span><span class="s2">&quot;argon2checkhash matches&quot;</span><span class="p">);</span>

See also