Method: Eth::Util#prefix_hex

Defined in:
lib/eth/util.rb

#prefix_hex(hex) ⇒ String

Prefixes a hexa-decimal string with 0x.

Parameters:

  • hex (String)

    a hex-string to be prefixed.

Returns:

  • (String)

    a prefixed hex-string.



74
75
76
# File 'lib/eth/util.rb', line 74

def prefix_hex(hex)
  "0x#{remove_hex_prefix hex}"
end