INNER CODE UNIT · Kotlin
genericHashStep2
terl/lazysodium-java · sample-app/src/main/kotlin/Main.kt:251
private fun genericHashStep2() {
log("+ Step 2: Random key hash.")
log(
" The following hashes should be different as we're using" +
" random keys for them."
)
val hashRandom: String = lazySodium.cryptoGenericHash("", lazySodium.cryptoGenericHashKeygen())
val hashRandom2: String = lazySodium.cryptoGenericHash("", lazySodium.cryptoGenericHashKeygen())
log()
logt("Hash 1: $hashRandom")
logt("Hash 2: $hashRandom2")
logt("Hash 1 == Hash 2? " + hashRandom.equals(hashRandom2, ignoreCase = true))
log()
}
private fun pwHashStep1() {
printSection("Running password hashing")
val pw = "superAwesomePassword"