Created
January 18, 2017 23:15
-
-
Save ran488/66c229a7704ae092b6d37380e8403e4b to your computer and use it in GitHub Desktop.
Generate a UUID from Ruby
This file contains hidden or 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
require 'securerandom' | |
puts SecureRandom.uuid | |
# OR | |
# direct from command line: jruby -e "require 'securerandom' ; puts SecureRandom.uuid" | |
# IRB | |
# irb(main):001:0> require 'securerandom' | |
# true | |
# irb(main):002:0> SecureRandom.uuid | |
# "8af55604-db60-4347-bb0a-1e13ac058685" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment