MCPcopy Index your code
hub / github.com/nodejs/node / countBinaryOnes

Function countBinaryOnes

lib/internal/util.js:807–812  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

805// Returns the number of ones in the binary representation of the decimal
806// number.
807function countBinaryOnes(n) {
808 // Count the number of bits set in parallel, which is faster than looping
809 n = n - ((n >>> 1) & 0x55555555);
810 n = (n & 0x33333333) + ((n >>> 2) & 0x33333333);
811 return ((n + (n >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24;
812}
813
814function getCIDR(address, netmask, family) {
815 let ones = 0;

Callers 1

getCIDRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…