module Web3::Hpb::Utility
Public Instance Methods
from_hex(h)
click to toggle source
# File lib/web3/hpb/utility.rb, line 14 def from_hex(h) h.to_i(16) end
hex(num)
click to toggle source
# File lib/web3/hpb/utility.rb, line 6 def hex(num) '0x' + num.to_s(16) end
remove_0x_head(s)
click to toggle source
# File lib/web3/hpb/utility.rb, line 18 def remove_0x_head(s) s[0, 2] == '0x' ? s[2..-1] : s end
wei_to_hpb(wei)
click to toggle source
# File lib/web3/hpb/utility.rb, line 10 def wei_to_hpb(wei) 1.0 * wei / 10**18 end