Skip to content

Instantly share code, notes, and snippets.

@davidlesches
Created December 27, 2013 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidlesches/fefc595a1d17913dd5d1 to your computer and use it in GitHub Desktop.
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
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