Skip to content

Commit

Permalink
[Truffle] Use #StringValue instead of manually checking for types in …
Browse files Browse the repository at this point in the history
…digest.
  • Loading branch information
chrisseaton committed May 19, 2015
1 parent 23eb994 commit d78025c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/ruby/truffle/truffle/digest.rb
Expand Up @@ -147,9 +147,7 @@ def block_length
end

def self.hexencode(message)
raise TypeError if message.nil?
raise TypeError if message.is_a? Fixnum
message.to_str.unpack('H*').first
StringValue(message).unpack('H*').first
end

end
4 changes: 1 addition & 3 deletions lib/ruby/truffle/truffle/digest/bubblebabble.rb
Expand Up @@ -11,9 +11,7 @@
module Digest

def self.bubblebabble(message)
raise TypeError if message.nil?
raise TypeError if message.is_a? Fixnum
Truffle::Digest.bubblebabble(message.to_str)
Truffle::Digest.bubblebabble(StringValue(message))
end

class Algorithm
Expand Down

0 comments on commit d78025c

Please sign in to comment.