Companion

object Companion

Functions

Link copied to clipboard
fun generateSalt(size: Int = SALT_SIZE): ByteArray

Generates a random salt for use in Argon2 hashing.

Link copied to clipboard
fun hash(input: String, salt: ByteArray = generateSalt(), builder: Argon2Parameters.Builder = argon2Builder): Argon2.Result

Hashes an input string using the Argon2 algorithm with the specified or generated salt.

Link copied to clipboard
fun String.hashWithArgon2(salt: ByteArray = generateSalt()): Argon2.Result

Hashes this string using the Argon2 algorithm with the specified or generated salt.

Link copied to clipboard
suspend fun verify(input: String, hash: ByteArray): Outcome<Boolean>

Verifies an input string against a provided hash and salt using the Argon2 algorithm.

Link copied to clipboard

Verifies an input string against this hash and the provided salt using the Argon2 algorithm.

Verifies this string against a provided hash and salt using the Argon2 algorithm.