library / org.akop.kotx.ext.basic / kotlin.ByteArray

Extensions for kotlin.ByteArray

md5

fun ByteArray.md5(): ByteArray

Computes MD5 hash for the byte array using MessageDigest.

sha1

fun ByteArray.sha1(): ByteArray

Computes SHA1 hash for the byte array using MessageDigest.

toBase64String

fun ByteArray.toBase64String(flags: Int = Base64.NO_WRAP): String

Returns Base64 representation of the byte array by calling Base64.encodeToString with specified flags.

toHexString

fun ByteArray.toHexString(): String

Returns the byte array as a hexadecimal string.