(encoded: Uint8Array)
| 48 | } |
| 49 | |
| 50 | function decodeBase64(encoded: Uint8Array) { |
| 51 | const byteChars = Array.from(encoded, (byte) => String.fromCodePoint(byte)); |
| 52 | |
| 53 | return btoa(byteChars.join('')); |
| 54 | } |
| 55 | |
| 56 | function encodeBase64(data: string) { |
| 57 | return Uint8Array.from(atob(data), (ch) => ch.codePointAt(0)!); |