(bytes: Uint8Array)
| 355 | }); |
| 356 | |
| 357 | const bytesToBase64 = (bytes: Uint8Array): string => { |
| 358 | let binary = ""; |
| 359 | const chunkSize = 0x8000; |
| 360 | for (let i = 0; i < bytes.length; i += chunkSize) { |
| 361 | binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize)); |
| 362 | } |
| 363 | return btoa(binary); |
| 364 | }; |
| 365 | |
| 366 | const normalizeBase64 = (value: string, encoding: "base64" | "base64url"): string => { |
| 367 | const compact = value.replace(/\s/g, ""); |
no outgoing calls
no test coverage detected