Initial import

This commit is contained in:
sirily
2026-03-10 14:03:52 +03:00
commit 6c0ca4e28b
102 changed files with 6598 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { createHash } from "node:crypto";
export function normalizePairingCode(code: string): string {
return code.trim().toUpperCase();
}
export function hashPairingCode(code: string): string {
return createHash("sha256").update(normalizePairingCode(code)).digest("hex");
}
export function isPairingExpired(expiresAt: Date, now: Date = new Date()): boolean {
return expiresAt.getTime() <= now.getTime();
}