Open ruebenramirez opened 8 years ago
def generate_code(number) charset = Array('A'..'Z') + Array('a'..'z') Array.new(number) { charset.sample }.join end puts generate_code(20)
source: https://www.blackbytes.info/2015/03/ruby-random/
source: https://www.blackbytes.info/2015/03/ruby-random/