Module: Base58::Private

Defined in:
lib/base58.rb

Class Method Summary collapse

Class Method Details

.int_to_hex(int) ⇒ Object



70
71
72
73
74
75
# File 'lib/base58.rb', line 70

def self.int_to_hex int
  hex = int.to_s(16)
  # The hex string must always consist of an even number of characters,
  # otherwise the pack() parsing will be misaligned.
  (hex.length % 2 == 0) ? hex : ('0'+hex)
end