hada
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

hada

helpers for converting between bytes, strings, numbers, and more

import * as hada from 'hada'

hada.bytesToInt([255, 255]) // 65535

hada.intToBytes(65535) // [255, 255]

hada.hexToBytes('ffff') // [255, 255]

hada.bytesToHex([255, 255]) // 'ffff'

hada.stringToAsciiHex('hello world') // '68656c6c6f20776f726c64'

hada.asciiHexToString('68656c6c6f20776f726c64') // 'hello world'

hada.stringToAsciiBytes('hello world')
//[104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]
                                         
hada.asciiBytesToString([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])
// 'hello world'

Package Sidebar

Install

npm i hada

Weekly Downloads

40

Version

0.0.9

License

MIT

Unpacked Size

5.77 kB

Total Files

4

Last publish

Collaborators

  • crsayen