-
-
Save davidlesches/fefc595a1d17913dd5d1 to your computer and use it in GitHub Desktop.
Yodlee and Rails Implementation, Part 4: User Management - app/models/yodlee/misc.rb
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 Yodlee | |
class Misc | |
def self.password_generator | |
chars = 'abcdefghijklmnopqrstuvwxyz1234567890' | |
password = chars.last(10).split(//).sample | |
begin | |
char = chars[rand(chars.size)] | |
password << char if password[-1] != char | |
end while password.length < 32 | |
password | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment