Node.js examples for Number:Int
Encode Int
exports.encodeInt = function(value) { var buffer = new Buffer(4); buffer[3] = (value >> 24) & 0xff; buffer[2] = (value >> 16) & 0xff; buffer[1] = (value >> 8) & 0xff; buffer[0] = value & 0xff;/*w w w . j a v a 2 s .c o m*/ return buffer; }