code: function encodeNumber(buf, value, len) {
    var index = 0;
    
    while (len > 0) {
      var tmpValue = value >>> ((len - 1) * 8);
      buf[index++] = tmpValue & 0xFF;
      len--;
    }
  }
docs: Encodes the given numeric value in the given Buffer, using the specified number of bytes.
  
  @param {Buffer} buf
  @param {number} value
  @param {number} len