MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / uint8ArrayToNumber

Function uint8ArrayToNumber

shared/tests/binary.test.ts:42–48  ·  view source on GitHub ↗
(arr: Uint8Array)

Source from the content-addressed store, hash-verified

40
41test('incrementRandom increments', () => {
42 function uint8ArrayToNumber(arr: Uint8Array) {
43 let num = 0n
44 for (const i of arr) {
45 num = num * 256n + BigInt(i)
46 }
47 return num
48 }
49 fc.assert(
50 fc.property(
51 fc.record({

Callers 1

binary.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected