* @param {number} byte
(byte)
| 159 | * @param {number} byte |
| 160 | */ |
| 161 | function 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 */ |