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