MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / asciiAt

Function asciiAt

projects/runtime-node/src/fileMetadata.ts:73–76  ·  view source on GitHub ↗
(sample: Uint8Array, start: number, length: number)

Source from the content-addressed store, hash-verified

71}
72
73function asciiAt(sample: Uint8Array, start: number, length: number): string {
74 if (sample.length < start + length) return ""
75 return String.fromCharCode(...sample.subarray(start, start + length))
76}
77
78function mediaTypeFromMagic(sample: Uint8Array): string | null {
79 if (hasPrefix(sample, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) return "image/png"

Callers 1

mediaTypeFromMagicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected