MCPcopy Create free account
hub / github.com/ClydeTime/Surge / Checksum

Function Checksum

Script/BiliBili/Modified.js:338–344  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

336
337 // 计算校验和 (B站为数据本体字节数)
338 function Checksum(num) {
339 let arr = new ArrayBuffer(4); // an Int32 takes 4 bytes
340 let view = new DataView(arr);
341 // 首位填充计算过的新数据长度
342 view.setUint32(0, num, false); // byteOffset = 0; litteEndian = false
343 return new Uint8Array(arr);
344 };
345};
346
347/***************** Function *****************/

Callers 1

newRawBodyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected