Nagging Mario's Princess
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    byteslicepublic

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

    Keywords

    none

    install

    npm i byteslice

    Downloadsweekly downloads

    3

    version

    0.2.0

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar