MCPcopy Create free account
hub / github.com/cameri/nostream / msb

Function msb

src/utils/proof-of-work.ts:14–27  ·  view source on GitHub ↗
(b: number)

Source from the content-addressed store, hash-verified

12}
13
14function msb(b: number) {
15 let n = 0
16
17 if (b == 0) {
18 return 8
19 }
20
21 // eslint-disable-next-line no-cond-assign
22 while ((b >>= 1)) {
23 n++
24 }
25
26 return 7 - n
27}

Callers 1

getLeadingZeroBitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected