MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / checkedMul

Function checkedMul

packages/plugins/apps/src/git-client/packfile.ts:65–69  ·  view source on GitHub ↗
(a: number, b: number, what: string)

Source from the content-addressed store, hash-verified

63};
64
65const checkedMul = (a: number, b: number, what: string): number => {
66 const value = a * b;
67 if (!Number.isSafeInteger(value)) throw new PackParseError(`${what} exceeds safe integer range`);
68 return value;
69};
70
71// sha1 over "type len\0data" to compute object id, needed to key REF_DELTA bases.
72// Minimal sha1 (needed because Workers crypto.subtle is async; git object ids are sha1).

Callers 3

readVarintSizeFunction · 0.85
readDeltaVarintFunction · 0.85
parsePackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected