(bytes: Uint8Array)
| 394 | }); |
| 395 | |
| 396 | const bytesToBase64 = (bytes: Uint8Array): string => { |
| 397 | let binary = ""; |
| 398 | const chunkSize = 0x8000; |
| 399 | for (let i = 0; i < bytes.length; i += chunkSize) { |
| 400 | binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize)); |
| 401 | } |
| 402 | return btoa(binary); |
| 403 | }; |
| 404 | |
| 405 | const normalizeBase64 = (value: string, encoding: "base64" | "base64url"): string => { |
| 406 | const compact = value.replace(/\s/g, ""); |
no outgoing calls
no test coverage detected