-
-
Notifications
You must be signed in to change notification settings - Fork 924
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4800d8f
commit 78953ad
Showing
2 changed files
with
7 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ def digest(message=NO_MESSAGE) | |
end | ||
|
||
def hexdigest(message=NO_MESSAGE) | ||
digest(message).unpack('H*').first | ||
Digest.hexencode(digest(message)) | ||
end | ||
|
||
alias_method :to_s, :hexdigest | ||
|
@@ -91,7 +91,6 @@ def hexdigest(message) | |
end | ||
|
||
class MD5 < Base | ||
|
||
extend BaseFunctions | ||
|
||
def initialize | ||
|
@@ -105,7 +104,6 @@ def block_length | |
end | ||
|
||
class SHA1 < Base | ||
|
||
extend BaseFunctions | ||
|
||
def initialize | ||
|
@@ -119,7 +117,6 @@ def block_length | |
end | ||
|
||
class SHA256 < Base | ||
|
||
extend BaseFunctions | ||
|
||
def initialize | ||
|
@@ -133,7 +130,6 @@ def block_length | |
end | ||
|
||
class SHA384 < Base | ||
|
||
extend BaseFunctions | ||
|
||
def initialize | ||
|
@@ -147,7 +143,6 @@ def block_length | |
end | ||
|
||
class SHA512 < Base | ||
|
||
extend BaseFunctions | ||
|
||
def initialize | ||
|
@@ -160,4 +155,10 @@ def block_length | |
|
||
end | ||
|
||
def self.hexencode(message) | ||
raise TypeError if message.nil? | ||
raise TypeError if message.is_a? Fixnum | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
chrisseaton
Author
Contributor
|
||
message.to_str.unpack('H*').first | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
Could we use a helper such as
StringValue
orcoerce_
from Rubinius here?