MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / extractInt32BE

Function extractInt32BE

app/rcc/scripts/parser/js/sirf_binary.js:137–141  ·  view source on GitHub ↗

* Extracts a 32-bit signed integer from byte array (big-endian).

(bytes, offset)

Source from the content-addressed store, hash-verified

135 * Extracts a 32-bit signed integer from byte array (big-endian).
136 */
137function extractInt32BE(bytes, offset) {
138 var value = (bytes[offset] << 24) | (bytes[offset + 1] << 16) |
139 (bytes[offset + 2] << 8) | bytes[offset + 3];
140 return value > 2147483647 ? value - 4294967296 : value;
141}
142
143/**
144 * Validates SiRF checksum.

Callers 1

sirf_binary.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected