refactor: cleanup backend structure

This commit is contained in:
2025-10-21 22:07:59 +03:00
parent 8e9c9585f2
commit 6c4b813f66
10 changed files with 100 additions and 100 deletions

View File

@@ -1,11 +1,11 @@
// https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem.
export function fromBase64(string: String) {
export function fromBase64(string) {
const binString = atob(string);
const bytes = Uint8Array.from(binString, (m) => m.codePointAt(0))
return new TextDecoder().decode(bytes);
}
export function toBase64(string: String) {
export function toBase64(string) {
const bytes = new TextEncoder().encode(string)
const binString = String.fromCodePoint(...bytes);
return btoa(binString);