MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / computeCheckSum

Function computeCheckSum

libraries/p5.js:6414–6429  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

6412}
6413
6414function computeCheckSum(bytes) {
6415 while (bytes.length % 4 !== 0) {
6416 bytes.push(0);
6417 }
6418
6419 var sum = 0;
6420 for (var i = 0; i < bytes.length; i += 4) {
6421 sum += (bytes[i] << 24) +
6422 (bytes[i + 1] << 16) +
6423 (bytes[i + 2] << 8) +
6424 (bytes[i + 3]);
6425 }
6426
6427 sum %= Math.pow(2, 32);
6428 return sum;
6429}
6430
6431function makeTableRecord(tag, checkSum, offset, length) {
6432 return new table.Table('Table Record', [

Callers 2

makeSfntTableFunction · 0.85
fontToSfntTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected