Module: Zilliqa::Util
- Extended by:
- Util
- Included in:
- Util
- Defined in:
- lib/zilliqa/util/unit.rb,
lib/zilliqa/util/util.rb,
lib/zilliqa/util/bech32.rb,
lib/zilliqa/util/validator.rb,
lib/zilliqa/util/difficulty.rb
Defined Under Namespace
Classes: Bech32, Difficulty, Unit, Validator
Instance Method Summary
collapse
Instance Method Details
#decode_hex(s) ⇒ Object
13
14
15
|
# File 'lib/zilliqa/util/util.rb', line 13
def decode_hex(s)
[s].pack('H*')
end
|
#encode_hex(b) ⇒ Object
9
10
11
|
# File 'lib/zilliqa/util/util.rb', line 9
def encode_hex(b)
b.unpack('H*').first
end
|
#pack(a, b) ⇒ Object
5
6
7
|
# File 'lib/zilliqa/util/util.rb', line 5
def pack(a, b)
a << 16 + b
end
|