(bytes: Uint8Array<ArrayBuffer>)
| 5 | |
| 6 | // https://web.dev/articles/base64-encoding#btoa_and_atob_with_unicode |
| 7 | export function arrayToBase64(bytes: Uint8Array<ArrayBuffer>): Base64 { |
| 8 | const binString = String.fromCodePoint(...bytes) |
| 9 | return btoa(binString).replaceAll('=', '') as Base64 |
| 10 | } |
| 11 | |
| 12 | // https://web.dev/articles/base64-encoding#btoa_and_atob_with_unicode |
| 13 | export function base64ToArray(base64: Base64): Uint8Array<ArrayBuffer> { |
no outgoing calls
no test coverage detected