refactor: improve type safety, update navigation, and optimize base64 encoding in auth and editor components

This commit is contained in:
Your Name
2026-04-11 19:33:50 +05:30
parent 4f0355d8eb
commit 9953b27385
7 changed files with 29 additions and 22 deletions
+2 -1
View File
@@ -66,7 +66,8 @@ export async function encryptLetter(plaintext: string, masterKey: CryptoKey) {
const rawKey = await crypto.subtle.exportKey("raw", dek);
// conversion to base64 for transit
const toBase64 = (buffer: Uint8Array) => btoa(String.fromCharCode(...buffer));
const toBase64 = (buf: Uint8Array) =>
btoa(buf.reduce((acc, b) => acc + String.fromCharCode(b), ""));
return {
// This goes to the server