add frontend AES-GCM and base64 helpers with Vitest coverage.

This commit is contained in:
2026-10-19 03:00:03 +02:00
parent f2987da2fe
commit 0238858c8b
29 changed files with 2021 additions and 2 deletions
@@ -0,0 +1,13 @@
import { base64ToBytes } from '@/utils/encoding/base64ToBytes';
export const base64UrlToBytes = (base64Url: string): Uint8Array => {
let base64 = base64Url.split('-').join('+').split('_').join('/');
const padding = base64.length % 4;
if (padding > 0) {
base64 += '='.repeat(4 - padding);
}
return base64ToBytes(base64);
};