feat: migrate to UnifiedPush

This commit is contained in:
Linus Rath
2026-04-20 10:54:26 +02:00
parent 15006086d2
commit 8b21851353
10 changed files with 396 additions and 84 deletions
+14
View File
@@ -0,0 +1,14 @@
export function b64uEncode(buf: Buffer | Uint8Array): string {
const b = Buffer.isBuffer(buf) ? buf : Buffer.from(buf);
return b
.toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=+$/, '');
}
export function b64uDecode(value: string): Buffer {
const padded = value.replace(/-/g, '+').replace(/_/g, '/');
const padLen = (4 - (padded.length % 4)) % 4;
return Buffer.from(padded + '='.repeat(padLen), 'base64');
}