UPDATE: split the webapp in a widget and the app itself
This splits the webapp in: * IronCalc (the widget to be published on npmjs) * The frontend for our "service" * Adds "dummy code" for the backend using sqlite
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
378f8351d3
commit
8215cfc9fb
18
webapp/app.ironcalc.com/frontend/src/components/util.ts
Normal file
18
webapp/app.ironcalc.com/frontend/src/components/util.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export function base64ToBytes(base64: string): Uint8Array {
|
||||
// const binString = atob(base64);
|
||||
// return Uint8Array.from(binString, (m) => m.codePointAt(0));
|
||||
|
||||
return new Uint8Array(
|
||||
atob(base64)
|
||||
.split("")
|
||||
.map((c) => c.charCodeAt(0)),
|
||||
);
|
||||
}
|
||||
|
||||
export function bytesToBase64(bytes: Uint8Array): string {
|
||||
const binString = Array.from(bytes, (byte) =>
|
||||
String.fromCodePoint(byte),
|
||||
).join("");
|
||||
// btoa(String.fromCharCode(...bytes));
|
||||
return btoa(binString);
|
||||
}
|
||||
Reference in New Issue
Block a user