lib/encode.js
function encode_8bit(data) {
    var len = data.length;
    var bits = [];

    for (var i = 0; i < len; i++) {
        pushBits(bits, 8, data[i]);
    }

    var res = {};

    var d = [0, 1, 0, 0];
    pushBits(d, 16, len);
    res.data10 = res.data27 = d.concat(bits);

    if (len < 256) {
        var d = [0, 1, 0, 0];
        pushBits(d, 8, len);
        res.data1 = d.concat(bits);
    }

    return res;
}
function encode_8bit(data) {
    var len = data.length;
    var bits = [];

    for (var i = 0; i < len; i++) {
        pushBits(bits, 8, data[i]);
    }

    var res = {};

    var d = [0, 1, 0, 0];
    pushBits(d, 16, len);
    res.data10 = res.data27 = d.concat(bits);

    if (len < 256) {
        var d = [0, 1, 0, 0];
        pushBits(d, 8, len);
        res.data1 = d.concat(bits);
    }

    return res;
}
function encode_8bit ( data ) { var len = data . length ; var bits = [ ] ; for ( var i = 0 ; i < len ; i ++ ) { pushBits ( bits , 8 , data [ i ] ) ; } var res = { } ; var d = [ 0 , 1 , 0 , 0 ] ; pushBits ( d , 16 , len ) ; res . data10 = res . data27 = d . concat ( bits ) ; if ( len < 256 ) { var d = [ 0 , 1 , 0 , 0 ] ; pushBits ( d , 8 , len ) ; res . data1 = d . concat ( bits ) ; } return res ; }
{{{1 8bit encode
{{{ 1 8bit encode