MCPcopy Create free account
hub / github.com/denoland/std / getByte

Function getByte

encoding/_common16.ts:68–78  ·  view source on GitHub ↗
(char: number, alphabet: Uint8Array)

Source from the content-addressed store, hash-verified

66}
67
68function getByte(char: number, alphabet: Uint8Array): number {
69 const byte = alphabet[char] ?? 16;
70 if (byte === 16) { // alphabet.Hex.length
71 throw new TypeError(
72 `Cannot decode input as hex: Invalid character (${
73 String.fromCharCode(char)
74 })`,
75 );
76 }
77 return byte;
78}

Callers 1

decodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected