MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / hasBinaryMagic

Function hasBinaryMagic

src/utils/binary.ts:26–36  ·  view source on GitHub ↗
(buf: Buffer)

Source from the content-addressed store, hash-verified

24];
25
26function hasBinaryMagic(buf: Buffer): boolean {
27 for (const sig of BINARY_MAGIC) {
28 if (buf.length < sig.length) continue;
29 let match = true;
30 for (let i = 0; i < sig.length; i++) {
31 if (buf[i] !== sig[i]) { match = false; break; }
32 }
33 if (match) return true;
34 }
35 return false;
36}
37
38export function isBinaryBuffer(buf: Buffer, sampleSize = 8000): boolean {
39 if (buf.length === 0) return false;

Callers 1

isBinaryBufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected