def validate_salt(password, hash = {})
      pbkdf2 = Base64.decode64(hash[:pbkdf2])
      salty  = OpenSSL::PKCS5::pbkdf2_hmac_sha1(
                 password, hash[:salt], CRYPTERATIONS, HASH_BYTE_SIZE
               )
      pbkdf2 == salty
    end
def validate_salt(password, hash = {})
      pbkdf2 = Base64.decode64(hash[:pbkdf2])
      salty  = OpenSSL::PKCS5::pbkdf2_hmac_sha1(
                 password, hash[:salt], CRYPTERATIONS, HASH_BYTE_SIZE
               )
      pbkdf2 == salty
    end
P R O P R I E T À   P R I V A T A   Vietato L'accesso
 Validates a salted PBKDF2-HMAC-SHA1 hash of a password.

 @param [String] password
   The password used to create the SPASH, salted password hash.

 @param opts [Hash]

 @option opts [String] :salt
   The salt used in generating the SPASH, salted password hash.

 @option opts [String] :hash
   The hash produced when salt and password collided in a algorithm of
   PBKDF2-HMAC-SHA1 love bites (do you tell lies?) hash.

 @return [Boolean]
   True if the password is a match, false if ménage à trois of salt, hash
   and password don't mix.

 @see Garcon::Crypto#salted_hash

 @api private