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

Function countBits

app/rcc/scripts/parser/js/rtcm_corrections.js:121–128  ·  view source on GitHub ↗

* Counts the number of set bits in a value (population count). * Used to determine the number of satellites in a satellite mask.

(value)

Source from the content-addressed store, hash-verified

119 * Used to determine the number of satellites in a satellite mask.
120 */
121function countBits(value) {
122 var count = 0;
123 while (value) {
124 count += value & 1;
125 value >>= 1;
126 }
127 return count;
128}
129
130/**
131 * Validates the RTCM CRC-24Q checksum.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected