Port of @pfrazee's pretty-hash function to print ByteArray data as a hex string
$ npm install @datkt/pretty-hash
import datkt.prettyhash.prettyHash
fun main(args: Array<String>) {
val bytes = bytesFrom(
0xde, 0xad, 0xbe, 0xef,
0xde, 0xad, 0xbe, 0xef
)
val string = prettyHash(bytes)
println(string) // deadbeefdeadbeef
}
Specify the following configuration in your modules .kc
file for the
konanc-config
.
repo[] = "@datkt/pretty-hash"
require[] = "pretty-hash"
library[] = "pretty-hash"
Converts given input into a pretty hash string made of hex characters.
- Kotlin/Native and the
konanc
command line program.
MIT