Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
Loading...
Searching...
No Matches
M8B\EtherBinder\RLP\Encoder Class Reference

Static Public Member Functions

static encodeHex (array $input)
 
static encodeBin (array $input)
 

Detailed Description

Encoder of RLP format capable of working with both binary and hex outputs. Internally works on binary.

Author
DubbaThony

Member Function Documentation

◆ 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$inputdata 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$inputdata to be encoded
Returns
string hex representation of encoded data

The documentation for this class was generated from the following file: