(array)
| 189 | const byteToHexLookupTable = Array.from({ length: 256 }, (_, index) => index.toString(16).padStart(2, '0')); |
| 190 | |
| 191 | export function uint8ArrayToHex(array) { |
| 192 | assertUint8Array(array); |
| 193 | |
| 194 | // Concatenating a string is faster than using an array. |
| 195 | let hexString = ''; |
| 196 | |
| 197 | // eslint-disable-next-line unicorn/no-for-loop -- Max performance is critical. |
| 198 | for (let index = 0; index < array.length; index++) { |
| 199 | hexString += byteToHexLookupTable[array[index]]; |
| 200 | } |
| 201 | |
| 202 | return hexString; |
| 203 | } |
| 204 | |
| 205 | const hexToDecimalLookupTable = { |
| 206 | 0: 0, |
no test coverage detected