Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
RlpItem.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Ethereum\RLP;
4 
5 
6 class RlpItem extends Rlp
7 {
8 
9  // Data String.
10  protected $rlpData;
11 
12  // StrLength of tha actual Data.
13  protected $dataStrLength;
14 
15  // Padded strLength of arg incl prefix.
16  protected $paddedStrLength;
17 
18  public function __construct($data)
19  {
20  $dataLength = self::getStringLengthAt($data, 0);
21  $this->dataStrLength = $dataLength;
22  $this->paddedStrLength = 64 + self::paddedLength($dataLength);
23  $this->rlpData = substr($data, 64, $this->dataStrLength);
24  }
25 
26  public function getCharLength()
27  {
29  }
30 
31  public function get()
32  {
33  return $this->rlpData;
34  }
35 
36 }