Created
June 24, 2018 06:18
-
-
Save rajat1saxena/ddd6301fd6564954e204eed23dcce2f4 to your computer and use it in GitHub Desktop.
print_sha512_checksum.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun printableHexString(data: ByteArray): String { | |
// Create Hex String | |
val hexString: StringBuilder = StringBuilder() | |
for (aMessageDigest:Byte in data) { | |
var h: String = Integer.toHexString(0xFF and aMessageDigest.toInt()) | |
while (h.length < 2) | |
h = "0$h" | |
hexString.append(h) | |
} | |
return hexString.toString() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment