Updated on 2026-08-14
This commit is contained in:
parent
926c92f700
commit
8bc1d4bc88
1 changed files with 6 additions and 0 deletions
|
|
@ -12,6 +12,12 @@ fun String.calculateSha256(): ByteArray {
|
|||
return sha256.digest(data)
|
||||
}
|
||||
|
||||
fun String.calculateSha512(): ByteArray {
|
||||
val sha = MessageDigest.getInstance("SHA-512")
|
||||
val data = this.toByteArray(Charset.forName("UTF-8"))
|
||||
return sha.digest(data)
|
||||
}
|
||||
|
||||
fun String.hexToBytes(): ByteArray {
|
||||
return ByteArray(this.length / 2)
|
||||
{ i ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue