hash

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.

Return

A Result containing the hash and the salt used.

Parameters

input

The input string to hash (e.g., a password).

salt

The salt to use for hashing (default: a newly generated salt via generateSalt).