invirt.utils.hash.kt Maven / Gradle / Ivy
package invirt.utils
import java.security.MessageDigest
fun String.sha256(): String {
val md = MessageDigest.getInstance("SHA-256")
val digest = md.digest(toByteArray())
return digest.fold("") { str, it -> str + "%02x".format(it) }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy