MCPcopy Create free account
hub / github.com/nodejs/node / hexByteToNumber

Function hexByteToNumber

deps/undici/src/lib/web/fetch/data-url.js:161–170  ·  view source on GitHub ↗

* @param {number} byte

(byte)

Source from the content-addressed store, hash-verified

159 * @param {number} byte
160 */
161function hexByteToNumber (byte) {
162 return (
163 // 0-9
164 byte >= 0x30 && byte <= 0x39
165 ? (byte - 48)
166 // Convert to uppercase
167 // ((byte & 0xDF) - 65) + 10
168 : ((byte & 0xDF) - 55)
169 )
170}
171
172// https://url.spec.whatwg.org/#percent-decode
173/** @param {Uint8Array} input */

Callers 1

percentDecodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected