mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
clean up code and logs (#1809)
abstract base64 functions and clean up console logs
This commit is contained in:
9
frontend/projects/shared/src/util/base-64.ts
Normal file
9
frontend/projects/shared/src/util/base-64.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user