#!/usr/bin/env ruby
require 'securerandom'
require 'pp'
# Ambiguous characters
# B8G6I1l0OQDS5Z2
# 0 and O (the letter), "l" lowercase L, and "I" uppercase "i".
# '0' can look like a 'O'
# '1' can look like a 'l'
# '2' can look like a 'Z'
# '5' can look like a 'S'
# '8' can look like a 'B'
# 'B' can look like a '8'
# 'I' can look like a '1'
# 'J' can look like a '1'
# 'L' can look like a '1'
# 'O' can look like a '0'
# 'S' can look like a '5'
# 'T' can look like a '1'
# 'Z' can look like a '2'
DIGITS = [3, 4, 6, 7, 9]
CHARACTERS = %w[C D E F G H K M N P Q R U V W X Y]
SYMBOLS = DIGITS + CHARACTERS
puts "All symbols: #{SYMBOLS.join(', ')}"
puts "All symbols count: #{SYMBOLS.count} (alphabet size)"
puts "Combinations: (alphabet size ^ how many symbols to use)"
1.upto(6) do |len|
line = format ' %d symbols lenght: %-10d | eg: %s',
len,
SYMBOLS.count.pow(len),
SYMBOLS.sample(len).join
puts line
end