Skip to content

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

Notifications You must be signed in to change notification settings

mikeal/byteslice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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']]

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published