Relay pairing offer v2 (E2EE) + host connections

This commit is contained in:
Mohamed Boudra
2026-02-04 22:53:00 +07:00
parent 9ce4ad9758
commit 0218729316
59 changed files with 2022 additions and 1547 deletions
+8 -1
View File
@@ -5,7 +5,14 @@ export function arrayBufferToBase64(buffer: ArrayBuffer): string {
}
export function base64ToArrayBuffer(base64: string): ArrayBuffer {
const bytes = toByteArray(base64);
const normalized = (() => {
const trimmed = base64.trim();
const standard = trimmed.replace(/-/g, "+").replace(/_/g, "/");
const padLen = (4 - (standard.length % 4)) % 4;
return standard + "=".repeat(padLen);
})();
const bytes = toByteArray(normalized);
const out = new Uint8Array(bytes.byteLength);
out.set(bytes);
return out.buffer;