def new_random_password self.password= Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--")[0,6] self.password_confirmation = self.password end
You need to create an account or log in to post comments to this site.
12372 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
def new_random_password self.password= Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--")[0,6] self.password_confirmation = self.password end
You need to create an account or log in to post comments to this site.
But ultimately, if somebody knows about when you created the password and what your username are, there aren't that many possibilities to try. It would be best to include something truly random, which is hard to do cross-platform.