lib/utils.js
function compare(buf1, buf2){
    if (buf1.length !== buf2.length)
        return buf1.length - buf2.length;

    for (var i = 0; i < buf1.length; i++)
        if (buf1[i] !== buf2[i])
            return buf1[i] - buf2[i];

    return 0;
}
function compare(buf1, buf2){
    if (buf1.length !== buf2.length)
        return buf1.length - buf2.length;

    for (var i = 0; i < buf1.length; i++)
        if (buf1[i] !== buf2[i])
            return buf1[i] - buf2[i];

    return 0;
}
function compare ( buf1 , buf2 ) { if ( buf1 . length !== buf2 . length ) return buf1 . length - buf2 . length ; for ( var i = 0 ; i < buf1 . length ; i ++ ) if ( buf1 [ i ] !== buf2 [ i ] ) return buf1 [ i ] - buf2 [ i ] ; return 0 ; }
Compares 2 buffers, works like C's memcmp.
@return {integer} -1 if buf1 is "smaller", 0 if both are equal,
1 if buf1 is "greater".
Compares 2 buffers works like C s memcmp .