Class: Etheruby::Encoders::Bytes
- Inherits:
-
Base
- Object
- Base
- Etheruby::Encoders::Bytes
show all
- Defined in:
- lib/etheruby/encoders/bytes.rb
Instance Attribute Summary
Attributes inherited from Base
#data
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#decode ⇒ Object
34
35
36
37
|
# File 'lib/etheruby/encoders/bytes.rb', line 34
def decode
size = Uint.new(data[0..63]).decode[0]
return Byte.new(size,data[64..data.length]).decode[0], determinate_closest_padding(size+32)
end
|
#encode ⇒ Object
30
31
32
|
# File 'lib/etheruby/encoders/bytes.rb', line 30
def encode
Uint.new(data.length).encode + Byte.new(data.length, data).encode
end
|