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.38 lib/rex/text/hash.rb
rex-text-0.2.37 lib/rex/text/hash.rb
rex-text-0.2.36 lib/rex/text/hash.rb
rex-text-0.2.35 lib/rex/text/hash.rb
rex-text-0.2.34 lib/rex/text/hash.rb
rex-text-0.2.33 lib/rex/text/hash.rb
rex-text-0.2.32 lib/rex/text/hash.rb
rex-text-0.2.31 lib/rex/text/hash.rb
rex-text-0.2.30 lib/rex/text/hash.rb
rex-text-0.2.29 lib/rex/text/hash.rb
rex-text-0.2.28 lib/rex/text/hash.rb
rex-text-0.2.27 lib/rex/text/hash.rb
rex-text-0.2.26 lib/rex/text/hash.rb
rex-text-0.2.25 lib/rex/text/hash.rb
rex-text-0.2.24 lib/rex/text/hash.rb
rex-text-0.2.23 lib/rex/text/hash.rb
rex-text-0.2.22 lib/rex/text/hash.rb
rex-text-0.2.21 lib/rex/text/hash.rb