(sample: Uint8Array, prefix: number[])
| 66 | const utf8Decoder = new TextDecoder("utf-8", { fatal: true }) |
| 67 | |
| 68 | function hasPrefix(sample: Uint8Array, prefix: number[]): boolean { |
| 69 | if (sample.length < prefix.length) return false |
| 70 | return prefix.every((byte, index) => sample[index] === byte) |
| 71 | } |
| 72 | |
| 73 | function asciiAt(sample: Uint8Array, start: number, length: number): string { |
| 74 | if (sample.length < start + length) return "" |
no outgoing calls
no test coverage detected