Displaying 1 result from an estimated 1 matches for "hexidigest".
Did you mean:
hexdigest
2006 Apr 21
4
Problem with the Authorization recipe
...`password=''
from (irb):4
>>
and here are my model:
class User < ActiveRecord::Base
validates_uniqueness_of :username
def password=(pass)
salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
self.password_salt, self.password_hash = salt,
Digest::SHA256.hexidigest(pass + salt)
end
end
Its clearly seems to be a problem of the SHA2 library but searching
around i cant find any reasonable info that helps to fix this problem,
hope someone can give me a hand with this :)
--
Posted via http://www.ruby-forum.com/.