like-bytes
v1.0.1
Published
Simple Uint8Array functions.
Readme
like-bytes
Simple Uint8Array functions.
npm i like-bytesUsage
const Bytes = require('like-bytes')
const a = Bytes.from('hello')
const b = Bytes.from('hello', 'hex')
const c = Bytes.from('hello', 'base58')
console.log(Bytes.toString(a))
// hello
console.log(Bytes.toString(b, 'hex'))
// hello
console.log(Bytes.toString(c, 'base58'))
// helloAPI
TODO
Bytes.isBytes(value)
Bytes.alloc(size, fill)
Bytes.view(value) // Zero-copy when possible
Bytes.from(value, encoding) // Always a new copy
Bytes.toString(value, encoding)
Bytes.concat(list)
Bytes.copy(source, target, start)
Bytes.fill(target, value)
Bytes.equals(a, b)
Bytes.compare(a, b)License
MIT
