/** Human-friendly trip reference, e.g. HH-4F7K2M. */
const ALPHABET = 'ABCDEFGHJKMNPQRSTUVWXYZ23456789' // no 0/O/1/I/L

export function generateRefCode(random: () => number = Math.random): string {
  let code = ''
  for (let i = 0; i < 6; i++) {
    code += ALPHABET[Math.floor(random() * ALPHABET.length)]
  }
  return `HH-${code}`
}
