We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19920b3 commit 6ec392cCopy full SHA for 6ec392c
lib/rex/text.rb
@@ -1,5 +1,6 @@
1
# -*- coding: binary -*-
2
require 'digest/md5'
3
+require 'digest/sha1'
4
require 'stringio'
5
6
begin
@@ -812,6 +813,20 @@ def self.md5(str)
812
813
Digest::MD5.hexdigest(str)
814
end
815
816
+ #
817
+ # Raw SHA1 digest of the supplied string
818
819
+ def self.sha1_raw(str)
820
+ Digest::SHA1.digest(str)
821
+ end
822
+
823
824
+ # Hexidecimal SHA1 digest of the supplied string
825
826
+ def self.sha1(str)
827
+ Digest::SHA1.hexdigest(str)
828
829
830
#
831
# Convert hex-encoded characters to literals.
832
# Example: "AA\\x42CC" becomes "AABCC"
0 commit comments