md5

fun String.md5(salt: String = ""): String

Computes the MD5 hash of this String with an optional string salt.

Not for passwords or other security uses. A single fast digest, salted or not, is not a password hash: store passwords with a dedicated password-hashing function such as Argon2id, scrypt, bcrypt or PBKDF2. MD5 is also broken for collision resistance, so use it only for non-adversarial checks such as cache keys.

Return

the hex-encoded MD5 hash

Parameters

salt

the salt string (default empty)


Computes the MD5 hash of this String with a byte array salt.

Not for passwords or other security uses. A single fast digest, salted or not, is not a password hash: store passwords with a dedicated password-hashing function such as Argon2id, scrypt, bcrypt or PBKDF2. MD5 is also broken for collision resistance, so use it only for non-adversarial checks such as cache keys.

Return

the hex-encoded MD5 hash

Parameters

salt

the salt bytes