July 30, 2019
Using Argon for Password Hashes
Include the argon2-jvm dependency in your build.boot or project.clj file.
[de.mkammerer/argon2-jvm "2.5"] In the module you need to use argon hashes, import the necessary classes in you namespace (ns) declaration:
(:import (de.mkammerer.argon2 Argon2Factory Argon2Factory$Argon2Types)) Now you can generate a hash or verify if a string matches a hash like below:
(defonce ^:private ^:const arg2-iterations 8) (defonce ^:private ^:const arg2-memory 65536) (defonce ^:private ^:const arg2-parallelism 1) (defn- argon2-hash "Hash string with Argon2id" [str-to-be-hashed] (.
Read more