This commit is contained in:
Stefan Pejcic
2024-11-07 19:03:37 +01:00
parent c6df945ed5
commit 09f9f9502d
2472 changed files with 620417 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
export const stringToBase64 = (str: string) => {
if (typeof btoa !== "undefined") {
return btoa(str);
}
return Buffer.from(str).toString("base64");
};
export const base64ToString = (base64: string) => {
if (typeof atob !== "undefined") {
return atob(base64);
}
return Buffer.from(base64, "base64").toString();
};