(bytes: Uint8Array)
| 59 | } |
| 60 | |
| 61 | function bytesToHex(bytes: Uint8Array): string { |
| 62 | let hex = "" |
| 63 | for (let i = 0; i < bytes.length; i += 1) { |
| 64 | hex += bytes[i].toString(16).padStart(2, "0") |
| 65 | } |
| 66 | return hex |
| 67 | } |
| 68 | |
| 69 | function randomBase62(length: number): string { |
| 70 | const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |