Something went wrong. Try again.
unoffical wafrn mirror wafrn.net
Something went wrong. Try again.
123456789101112131415import crypto from 'crypto'
export default function generateRandomString() { return crypto.createHash('sha1').update(Math.random().toString()).digest('hex')}
export function generateRandomStringInviteCode() { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; const code = Array.from({ length: 4 }, () => { return Array.from({ length: 4 }, () => { return chars[Math.floor(Math.random() * chars.length)]; }).join(''); }).join('-'); return code}