Sha256: b7b657e43b32f497b599338ec7ae67e712b9b8b189333a77c8d601860c0377fe

Contents?: true

Size: 1.09 KB

Versions: 38

Compression:

Stored size: 1.09 KB

Contents

# -*- coding: binary -*-
module Rex
  module Text
    # We are re-opening the module to add these module methods.
    # Breaking them up this way allows us to maintain a little higher
    # degree of organisation and make it easier to find what you're looking for
    # without hanging the underlying calls that we historically rely upon.

    #
    # Raw MD5 digest of the supplied string
    #
    def self.md5_raw(str)
      Digest::MD5.digest(str)
    end

    #
    # Hexidecimal MD5 digest of the supplied string
    #
    def self.md5(str)
      Digest::MD5.hexdigest(str)
    end

    #
    # Raw SHA1 digest of the supplied string
    #
    def self.sha1_raw(str)
      Digest::SHA1.digest(str)
    end

    #
    # Hexidecimal SHA1 digest of the supplied string
    #
    def self.sha1(str)
      Digest::SHA1.hexdigest(str)
    end
    
    #
    # Raw SHA2 digest of the supplied string
    #
    def self.sha2_raw(str)
      Digest::SHA2.digest(str)
    end

    #
    # Hexidecimal SHA2 digest of the supplied string
    #
    def self.sha2(str)
      Digest::SHA2.hexdigest(str)
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rex-text-0.2.59 lib/rex/text/hash.rb
rex-text-0.2.57 lib/rex/text/hash.rb
rex-text-0.2.56 lib/rex/text/hash.rb
rex-text-0.2.55 lib/rex/text/hash.rb
rex-text-0.2.54 lib/rex/text/hash.rb
rex-text-0.2.53 lib/rex/text/hash.rb
rex-text-0.2.52 lib/rex/text/hash.rb
rex-text-0.2.51 lib/rex/text/hash.rb
rex-text-0.2.50 lib/rex/text/hash.rb
rex-text-0.2.49 lib/rex/text/hash.rb
rex-text-0.2.48 lib/rex/text/hash.rb
rex-text-0.2.47 lib/rex/text/hash.rb
rex-text-0.2.46 lib/rex/text/hash.rb
rex-text-0.2.45 lib/rex/text/hash.rb
rex-text-0.2.44 lib/rex/text/hash.rb
rex-text-0.2.43 lib/rex/text/hash.rb
rex-text-0.2.42 lib/rex/text/hash.rb
rex-text-0.2.41 lib/rex/text/hash.rb
rex-text-0.2.40 lib/rex/text/hash.rb
rex-text-0.2.39 lib/rex/text/hash.rb