Files
start-os/frontend/projects/shared/src/util/base-64.ts
Matt Hill 1150f4c438 clean up code and logs (#1809)
abstract base64 functions and clean up console logs
2022-09-19 12:59:41 -06:00

10 lines
260 B
TypeScript

import * as Base64 from 'base64-js'
export function encodeBase64(text: string) {
return Base64.fromByteArray(new TextEncoder().encode(text))
}
export function decodeBase64(encoded: string) {
return new TextDecoder().decode(Base64.toByteArray(encoded))
}