net.dankito.utils.extensions.ByteArrayExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-utils Show documentation
Show all versions of java-utils Show documentation
Some basic utils needed in many projects
package net.dankito.utils.extensions
fun ByteArray.toHexString(): String {
val hexString = StringBuilder()
for (index in 0 until this.size) {
hexString.append(String.format("%02x", (0xFF and this[index].toInt())))
}
return hexString.toString()
}