(arr: Uint8Array)
| 6 | } |
| 7 | |
| 8 | export function uint8ArrayToBigInt(arr: Uint8Array) { |
| 9 | // Convert Uint8Array to hex string |
| 10 | const hex = Array.from(arr) |
| 11 | .map((b) => b.toString(16).padStart(2, "0")) |
| 12 | .join(""); |
| 13 | |
| 14 | return BigInt(`0x${hex}`); |
| 15 | } |
| 16 | |
| 17 | export function stringToUint8Array(str: string) { |
| 18 | const encoder = new TextEncoder(); |
no test coverage detected