const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; export default function randomString(amount = 8) { return Array.from(Array(amount)).reduce((finale) => { return `${finale}${CHARS.charAt(Math.floor(Math.random() * CHARS.length))}`; }, ''); }