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

Function hex

packages/effect/src/internal/jsonParser.ts:94–104  ·  view source on GitHub ↗
(count: number)

Source from the content-addressed store, hash-verified

92 }
93
94 const hex = (count: number) => {
95 let value = 0
96 for (const end = i + count; i < end; i++) {
97 const code = text.charCodeAt(i)
98 const lower = code | 0x20
99 if (isDigit(code)) value = value * 16 + code - 0x30
100 else if (lower >= 0x61 && lower <= 0x66) value = value * 16 + lower - 0x57
101 else fail(i)
102 }
103 return String.fromCharCode(value)
104 }
105
106 const number = () => {
107 if (!json5) {

Callers 2

stringFunction · 0.70
identifierFunction · 0.70

Calls 2

isDigitFunction · 0.70
failFunction · 0.70

Tested by

no test coverage detected