@datkt/pretty-hash

1.1.1 • Public • Published

pretty-hash

Port of @pfrazee's pretty-hash function to print ByteArray data as a hex string

Installation

$ npm install @datkt/pretty-hash

Usage

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
}

konanc Config

Specify the following configuration in your modules .kc file for the konanc-config.

repo[] = "@datkt/pretty-hash"
require[] = "pretty-hash"
library[] = "pretty-hash"

API

prettyHash(bytes: Any? = null): String"

Converts given input into a pretty hash string made of hex characters.

Prerequisites

See Also

License

MIT

Package Sidebar

Install

npm i @datkt/pretty-hash

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

4.77 kB

Total Files

10

Last publish

Collaborators

  • vipyne
  • werle