Skip to content

Instantly share code, notes, and snippets.

@kynatro
Created August 4, 2017 05:25
Show Gist options
  • Save kynatro/18877d7d51631a416a87cf829086a472 to your computer and use it in GitHub Desktop.
Save kynatro/18877d7d51631a416a87cf829086a472 to your computer and use it in GitHub Desktop.
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