Encoder of RLP format capable of working with both binary and hex outputs. Internally works on binary.
- Author
- DubbaThony
◆ encodeBin()
static M8B\EtherBinder\RLP\Encoder::encodeBin |
( |
array | $input | ) |
|
|
static |
Converts data to RLP Accepts array (recursively - can contain sub-arrays, sub-sub-arrays, etc.) of 0x-hex strings, ints, Hash (and children) types. All non-hex-strings will be converted to hex strings as actual strings (ie. "foo" will be 0x666f6f - 102, 111, 111). Entire input will NOT be wrapped with array, as some might expect. If you require this (ie. legacy transactions), wrap the input on caller side
- Parameters
-
array | $input | data to be encoded |
- Returns
- string binary blob of encoded data
◆ encodeHex()
static M8B\EtherBinder\RLP\Encoder::encodeHex |
( |
array | $input | ) |
|
|
static |
Converts data to RLP Accepts array (recursively - can contain sub-arrays, sub-sub-arrays, etc.) of 0x-hex strings, ints, Hash (and children) types. All non-hex-strings will be converted to hex strings as actual strings (ie. "foo" will be 0x666f6f - 102, 111, 111). Entire input will NOT be wrapped with array, as some might expect. If you require this (ie. legacy transactions), wrap the input on caller side
- Parameters
-
array | $input | data to be encoded |
- Returns
- string hex representation of encoded data
The documentation for this class was generated from the following file: