Sha256: e285d900ff5a5a4db41d644ab4dd3c6392191dc7880ae820b11711c7c38c2582

Contents?: true

Size: 410 Bytes

Versions: 11

Compression:

Stored size: 410 Bytes

Contents

module Bip44
  module Utils
    def self.hex_to_bin(string)
      RLP::Utils.decode_hex string
    end

    def self.bin_to_hex(string)
      RLP::Utils.encode_hex string
    end

    def self.padding64(str)
      if str =~ /^0x[a-f0-9]*/
        str = str[2 .. str.length-1]
      end
      str.rjust(64, '0')
    end

    def self.prefix_hex(hex)
      hex.match(/\A0x/) ? hex : "0x#{hex}"
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
bip44-extended-0.2.26 lib/bip44/utils.rb
bip44-extended-0.2.25 lib/bip44/utils.rb
bip44-extended-0.2.24 lib/bip44/utils.rb
bip44-extended-0.2.23 lib/bip44/utils.rb
bip44-extended-0.2.22 lib/bip44/utils.rb
bip44-extended-0.2.21 lib/bip44/utils.rb
bip44-extended-0.2.20 lib/bip44/utils.rb
bip44-0.2.18 lib/bip44/utils.rb
bip44-0.2.16 lib/bip44/utils.rb
bip44-0.2.14 lib/bip44/utils.rb
bip44-0.2.13 lib/bip44/utils.rb