I'm following through the tutorial from the book Agile Web Development with Rails and I found the following code:
def User.encrypt_password(password, salt)
Digest::SHA2.hexdigest(password + "wibble" + salt)
end
Looking into the Digest
source code (digest.rb
and digest/sha2.rb
inside the lib
directory in my ruby installation), however, I can't seem to find where the hexdigest
method is defined, but yet the code seems to work just fine.
Can someone enlighten me how this happens? I assume that I need to look for a code that somehow looks like:
def hexdigest(...)
...
end