# module Digest::Instance

### Public Instance Methods

base64digest(str = nil) click to toggle source

From Ruby 1.9.2 source

    # File lib/facets/digest/base64digest.rb, line 12
    def base64digest(str = nil)
      [str ? digest(str) : digest].pack('m0')
    end

base64digest!() click to toggle source

From Ruby 1.9.2 source

    # File lib/facets/digest/base64digest.rb, line 21
    def base64digest!
      [digest!].pack('m0')
    end

salted_base64digest(str, salt) click to toggle source

CREDIT: Guido De Rosa

    # File lib/facets/digest/salted_digest.rb, line 21
    def salted_base64digest(str, salt)
      [salted_digest(str, salt)].pack('m0')
    end

salted_digest(str='', salt=:auto) click to toggle source

CREDIT: Guido De Rosa

    # File lib/facets/digest/salted_digest.rb, line 8
    def salted_digest(str='', salt=:auto)
      if salt == :auto
        salt = String.random_binary(digest_length)
      end
      digest(str + salt) + salt
    end

salted_hexdigest(str, salt) click to toggle source

CREDIT: Guido De Rosa

    # File lib/facets/digest/salted_digest.rb, line 16
    def salted_hexdigest(str, salt)
      Digest.hexencode(salted_digest(str, salt))
    end