Skip to content

Instantly share code, notes, and snippets.

View kelhusseiny's full-sized avatar
🤡
How about another joke, Murray?

Karim El-Husseiny kelhusseiny

🤡
How about another joke, Murray?
View GitHub Profile
salt = BCrypt::Engine.generate_salt
encrypted_password = BCrypt::Engine.hash_secret(password, salt)
attr_accessible :username, :email, :password, :password_confirmation
match ':controller(/:action(/:id))(.:format)'
before_filter :save_login_state, :only => [:new, :create]
$ rake db:create
$ rake db:migrate
require 'digest/sha1'
encrypted_password= Digest::SHA1.hexdigest(password)
salt= Digest::SHA1.hexdigest("# We add {email} as unique value and #{Time.now} as random value")
encrypted_password= Digest::SHA1.hexdigest("Adding #{salt} to {password}")