encode_LONG function
dynamic
encode_LONG(
- dynamic v
Convert a 32-bit unsigned integer to a list of 4 bytes. @param {number} @returns {Array}
Implementation
encode_LONG(v) {
// Two's complement
if (v >= LIMIT32) {
v = -(2 * LIMIT32 - v);
}
return [(v >> 24) & 0xFF, (v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF];
}