Created
July 13, 2014 03:03
-
-
Save tamouse/ffa0365102ae520fdefc to your computer and use it in GitHub Desktop.
doing something like an airline confirmation code with securerandom
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
[1] pry(main)> require 'securerandom' | |
=> true | |
[2] pry(main)> SecureRandom.hex(6).upcase | |
=> "123B1EEF6F4C" | |
[3] pry(main)> SecureRandom.hex(3).upcase | |
=> "917522" | |
[4] pry(main)> SecureRandom.hex(3).upcase | |
=> "3EE4B5" | |
[5] pry(main)> SecureRandom.hex(3).upcase | |
=> "2188BB" | |
[6] pry(main)> SecureRandom.hex(3).upcase | |
=> "04556C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment