MCPcopy Index your code
hub / github.com/codedogQBY/ReadAny / checkMagic

Function checkMagic

packages/core/src/utils/umd-parser.ts:115–124  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

113}
114
115function checkMagic(bytes: Uint8Array): void {
116 if (bytes.length < 4) {
117 throw new Error("UMD: file too short");
118 }
119 for (let i = 0; i < 4; i++) {
120 if (bytes[i] !== UMD_MAGIC[i]) {
121 throw new Error("UMD: invalid magic bytes");
122 }
123 }
124}
125
126/**
127 * Parse a UMD file from a byte buffer.

Callers 1

parseUmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected