module Bip44::Utils

Public Class Methods

bin_to_hex(string) click to toggle source
# File lib/bip44/utils.rb, line 7
def self.bin_to_hex(string)
  RLP::Utils.encode_hex string
end
hex_to_bin(string) click to toggle source
# File lib/bip44/utils.rb, line 3
def self.hex_to_bin(string)
  RLP::Utils.decode_hex string
end
padding64(str) click to toggle source
# File lib/bip44/utils.rb, line 11
def self.padding64(str)
  if str =~ /^0x[a-f0-9]*/
    str = str[2 .. str.length-1]
  end
  str.rjust(64, '0')
end
prefix_hex(hex) click to toggle source
# File lib/bip44/utils.rb, line 18
def self.prefix_hex(hex)
  hex.match(/\A0x/) ? hex : "0x#{hex}"
end