INNER CODE UNIT · Kotlin
pwHashStep3
terl/lazysodium-java · sample-app/src/main/kotlin/Main.kt:317
private fun pwHashStep3() {
val pw = "password"
printStep(
"2",
"Multiple password hashing (Lazy)",
("Hashing password '" + pw + "' using Argon2 lazy methods. " +
"This also may take a while...")
)
log()
var i = 0
// In the following while loop, we keep hashing the above password
// then we verify it. If at any point we aren't successful we log it.
while (i < 30) {
try {
// You can also remove the null bytes at the end of this hex hash
// using cryptoPwHashStrRemoveNulls instead of
// cryptoPwHashStr, but that is not recommended