Merge branch 'master' into feature/addp-modules

bug/bundler_fix
HD Moore 2012-11-02 15:40:36 -05:00
commit 52f0bca9be
1 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'digest/md5' require 'digest/md5'
require 'digest/sha1'
require 'stringio' require 'stringio'
begin begin
@ -812,6 +813,20 @@ module Text
Digest::MD5.hexdigest(str) Digest::MD5.hexdigest(str)
end 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
# #
# Convert hex-encoded characters to literals. # Convert hex-encoded characters to literals.
# Example: "AA\\x42CC" becomes "AABCC" # Example: "AA\\x42CC" becomes "AABCC"