Create a gist now

Instantly share code, notes, and snippets.

Embed
Generate codes
# How many codes to make
quantity = 30000
# Path to the file to be written
dest_file = 'codes.csv'
codes = []
quantity.times do
codes << "#{SecureRandom.hex(6)}".upcase
end
File.open(dest_file, "w") do |file|
file.write codes.join("\n")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment