(byteArray: Uint8Array)
| 3 | // use b64ToUrlEncoded to convert to URL safe b64 |
| 4 | |
| 5 | function ArrayToHex(byteArray: Uint8Array): string { |
| 6 | return Array.prototype.map |
| 7 | .call(byteArray, (byte: number) => { |
| 8 | return ('0' + (byte & 0xff).toString(16)).slice(-2) |
| 9 | }) |
| 10 | .join('') |
| 11 | } |
| 12 | |
| 13 | export function generateRandomId(size = 16): string { |
| 14 | const buffer = new Uint8Array(size) |