Skip to content

Commit

Permalink
change binary_to_base58 to use unpack for consistency with base58_to_…
Browse files Browse the repository at this point in the history
…binary
  • Loading branch information
joelnordell committed Jan 10, 2018
1 parent 4c4191a commit c880902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/base58.rb
Expand Up @@ -53,7 +53,7 @@ def self.binary_to_base58(binary_val, alphabet = :flickr, include_leading_zeroes
prefix = ''
end

prefix + int_to_base58(binary_val.bytes.inject{|a,b|(a<<8)+b}, alphabet)
prefix + int_to_base58(binary_val.unpack('H*')[0].to_i(16), alphabet)
end

# Converts a base58 string to an ASCII-8BIT (binary) encoded string.
Expand Down

0 comments on commit c880902

Please sign in to comment.