(bytes: Uint8Array)
| 348 | }); |
| 349 | |
| 350 | const bytesToBase64 = (bytes: Uint8Array): string => { |
| 351 | let binary = ""; |
| 352 | const chunkSize = 0x8000; |
| 353 | for (let i = 0; i < bytes.length; i += chunkSize) { |
| 354 | binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize)); |
| 355 | } |
| 356 | return btoa(binary); |
| 357 | }; |
| 358 | |
| 359 | const normalizeBase64 = (value: string, encoding: "base64" | "base64url"): string => { |
| 360 | const compact = value.replace(/\s/g, ""); |
no outgoing calls
no test coverage detected