handy online tools for AT Protocol boat.kelinci.net
atproto bluesky atcute typescript solidjs
at trunk 10 lines 252 B view raw
1export const TOTP_RE = /^([a-zA-Z0-9]{5})[\- ]?([a-zA-Z0-9]{5})$/; 2 3export const formatTotpCode = (code: string) => { 4 const match = TOTP_RE.exec(code); 5 if (match !== null) { 6 return `${match[1]}-${match[2]}`.toUpperCase(); 7 } 8 9 return undefined; 10};