Created
August 1, 2014 22:25
-
-
Save gtd/8c24a6eaaef91ad4d66e to your computer and use it in GitHub Desktop.
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
module RandomCode | |
extend self | |
def generate(size = 8) | |
charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T U V W X Y Z } | |
(0...size).map{ charset[SecureRandom.random_number(charset.size)] }.join | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment