Created
November 7, 2015 01:31
-
-
Save davidtolsma/ba259144845ee4dc3dd2 to your computer and use it in GitHub Desktop.
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
def uid(length=10) | |
dictionary = %w[A C D E F H J K L M N P R T W X Y Z 3 4 6 7 9] | |
dictionary_length = dictionary.length | |
uid = '' | |
(1..length).each do |n| | |
uid << dictionary[rand(0..dictionary_length)].to_s | |
end | |
uid | |
end | |
puts uid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment