const randomChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'

export function randomString (length = 20) {
  const values = new Uint32Array(length)
  window.crypto.getRandomValues(values)

  return Array.from(values.map(v => v % randomChars.length)).map(c => randomChars[c]).join('')
}
