Merge branch 'master' into feature/addp-modules
commit
52f0bca9be
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue