(str: string)
| 24 | } |
| 25 | |
| 26 | export function encodeBASE64(str: string): string { |
| 27 | const bytes = new TextEncoder().encode(str); |
| 28 | let binary = ""; |
| 29 | for (let i = 0; i < bytes.byteLength; i++) { |
| 30 | binary += String.fromCharCode(bytes[i]); |
| 31 | } |
| 32 | return btoa(binary); |
| 33 | } |
| 34 | |
| 35 | export function decodeBASE64(str: string): string { |
| 36 | const binary = atob(str); |
nothing calls this directly
no outgoing calls
no test coverage detected