Created
August 4, 2017 05:25
-
-
Save kynatro/18877d7d51631a416a87cf829086a472 to your computer and use it in GitHub Desktop.
Generate codes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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