GenerateArgon2Hash()
Returns hash of input using Argon2.
Introduced: 5.3.8.18
Requires Extension: Argon2 Extension
GenerateArgon2Hash( input=string, variant=string, parallelismFactor=number, memoryCost=number, iterations=number );
Returns: 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">"generateArgon2Hash"</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">"argon2checkhash matches"</span><span class="p">);</span>
See also
- Cryptography
- Argon2CheckHash()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)