Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
Rlp Class Reference
+ Inheritance diagram for Rlp:
+ Collaboration diagram for Rlp:

Static Public Member Functions

static encode (string $val)
 
static decode (string $hexVal)
 
static getByteValueAtOffsetPos (string $msgData, int $pos)
 
- Static Public Member Functions inherited from EthereumStatic
static getMethodSignature ($input)
 
static phpKeccak256 ($string)
 
static sha3 ($string)
 
static isValidFunction ($input)
 
static getDefinition ()
 
static isValidHexQuantity ($str)
 
static isValidHexData ($str)
 
static isValidAddress ($address, $throw=false)
 
static hasHexPrefix ($str)
 
static removeHexPrefix ($str)
 
static ensureHexPrefix ($str)
 
static convertCurrency (float $amount, string $from='wei', string $to='ether')
 

Public Attributes

const THRESHOLD_LONG = 110
 
const PREF_SELF_CONTAINED = 127
 
const OFFSET_SHORT_ITEM = 128
 
const OFFSET_LONG_ITEM = 183
 
const OFFSET_SHORT_LIST = 192
 
const OFFSET_LONG_LIST = 247
 

Static Protected Member Functions

static processSingleByteItem (string $msgData, RLPCollection $rlpCollection, int $currentPos)
 
static getByteValueAt (string $msgData, int $pos)
 
static getStringLengthAt (string $msgData, int $pos)
 
static getByteLength (int $l)
 
static getLengthInByte (string $str, int $currentPos)
 
static paddedLength (int $length)
 

Detailed Description

Definition at line 18 of file Rlp.php.

Member Function Documentation

◆ decode()

static decode ( string  $hexVal)
static
Parameters
string$hexVal
Returns
[]
Exceptions

Definition at line 100 of file Rlp.php.

Referenced by EthS\cretateFromRLP(), and EthBytes\cretateFromRLP().

+ Here is the caller graph for this function:

◆ encode()

static encode ( string  $val)
static

Enecode RLP Hex argument.

Parameters
string$valHex string of value.
Returns
string Hex string. Encoded byte value with RLP prefixes.
Exceptions

Definition at line 43 of file Rlp.php.

Referenced by EthS\rlpVal(), and EthBytes\rlpVal().

+ Here is the caller graph for this function:

◆ getByteLength()

static getByteLength ( int  $l)
staticprotected
Deprecated:
??
Parameters
int$lByte length.
Returns
string uint256 hex value
Exceptions
Exception

Definition at line 329 of file Rlp.php.

◆ getByteValueAt()

static getByteValueAt ( string  $msgData,
int  $pos 
)
staticprotected

Definition at line 285 of file Rlp.php.

◆ getByteValueAtOffsetPos()

static getByteValueAtOffsetPos ( string  $msgData,
int  $pos 
)
static

ONLY GET THE LAST BYTE

Parameters
string$msgData
int$pos
Returns
int

Definition at line 311 of file Rlp.php.

◆ getLengthInByte()

static getLengthInByte ( string  $str,
int  $currentPos 
)
staticprotected
Parameters
string$str
Returns
float|int

Definition at line 340 of file Rlp.php.

◆ getStringLengthAt()

static getStringLengthAt ( string  $msgData,
int  $pos 
)
staticprotected
Parameters
string$msgData
int$pos
Returns
float|int

Definition at line 297 of file Rlp.php.

◆ paddedLength()

static paddedLength ( int  $length)
staticprotected
Parameters
int$length
Returns
int

Definition at line 350 of file Rlp.php.

◆ processSingleByteItem()

static processSingleByteItem ( string  $msgData,
RLPCollection  $rlpCollection,
int  $currentPos 
)
staticprotected
Parameters
string$msgData
\Ethereum\RLP\RlpCollection$rlpCollection
int$currentPosgth

Definition at line 257 of file Rlp.php.

Member Data Documentation

◆ OFFSET_LONG_ITEM

const OFFSET_LONG_ITEM = 183

Definition at line 27 of file Rlp.php.

◆ OFFSET_LONG_LIST

const OFFSET_LONG_LIST = 247

Definition at line 29 of file Rlp.php.

◆ OFFSET_SHORT_ITEM

const OFFSET_SHORT_ITEM = 128

Definition at line 26 of file Rlp.php.

◆ OFFSET_SHORT_LIST

const OFFSET_SHORT_LIST = 192

Definition at line 28 of file Rlp.php.

◆ PREF_SELF_CONTAINED

const PREF_SELF_CONTAINED = 127

Definition at line 25 of file Rlp.php.

◆ THRESHOLD_LONG

const THRESHOLD_LONG = 110

Definition at line 24 of file Rlp.php.


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