MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromHexChar

Function fromHexChar

packages/effect/src/Encoding.ts:755–769  ·  view source on GitHub ↗
(byte: number)

Source from the content-addressed store, hash-verified

753}
754
755const fromHexChar = (byte: number) => {
756 if (48 <= byte && byte <= 57) {
757 return byte - 48
758 }
759
760 if (97 <= byte && byte <= 102) {
761 return byte - 97 + 10
762 }
763
764 if (65 <= byte && byte <= 70) {
765 return byte - 65 + 10
766 }
767
768 throw new TypeError("Invalid input")
769}
770
771const bytesToHex = [
772 "00",

Callers 1

decodeHexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected