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

Function fromHexChar

packages/effect/src/internal/encoding/hex.ts:298–315  ·  view source on GitHub ↗
(byte: number)

Source from the content-addressed store, hash-verified

296
297/** @internal */
298const fromHexChar = (byte: number) => {
299 // '0' <= byte && byte <= '9'
300 if (48 <= byte && byte <= 57) {
301 return byte - 48
302 }
303
304 // 'a' <= byte && byte <= 'f'
305 if (97 <= byte && byte <= 102) {
306 return byte - 97 + 10
307 }
308
309 // 'A' <= byte && byte <= 'F'
310 if (65 <= byte && byte <= 70) {
311 return byte - 65 + 10
312 }
313
314 throw new TypeError("Invalid input")
315}

Callers 1

decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…