MCPcopy Create free account
hub / github.com/nodejs/node / checksum

Function checksum

test/parallel/test-quic-stream-recv-coalescing.mjs:43–49  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

41}
42
43function checksum(data) {
44 let sum = 0;
45 for (let i = 0; i < data.byteLength; i++) {
46 sum = (sum + data[i]) | 0;
47 }
48 return sum;
49}
50
51// Compute expected checksum across all payloads.
52let expectedChecksum = 0;

Calls

no outgoing calls

Tested by

no test coverage detected