byteslice

0.2.0 • Public • Published

byteslice

Simple way to concat and slice arrays through bytewise encoding and decoding.

var b = byteslice(['yes', 1])

bytewise.decode( b.encode(['x']) )
// [['yes', 1], ['x']]
b.decode(b.encode(['x']))
// ['x']

bytewise.decode( b.encode(['x', ['y']]) )
// [['yes', 1], ['x', ['y']]]
b.decode(b.encode(['x', ['y']]))
// ['x', ['y']]

b = b.concat(['no', 0])

bytewise.decode( b.encode(['x']) )
// [['yes', 1], ['no', 0], ['x']]
b.decode(b.encode(['x']))
// ['x']

bytewise.decode( b.encode(['x', ['y']]) )
// [['yes', 1], ['no', 0], ['x', ['y']]]
b.decode(b.encode(['x', ['y']]))
// ['x', ['y']]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i byteslice

Weekly Downloads

1

Version

0.2.0

License

BSD

Last publish

Collaborators

  • mikeal