Create a gist now

Instantly share code, notes, and snippets.

@davidlesches /misc.rb Secret
Created Dec 27, 2013

What would you like to do?
Yodlee and Rails Implementation, Part 4: User Management - app/models/yodlee/misc.rb
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