-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
|
||
/** | ||
* This file is part of rlp package. | ||
* | ||
* | ||
* (c) Kuan-Cheng,Lai <[email protected]> | ||
* | ||
* | ||
* @author Peter Lai <[email protected]> | ||
* @license MIT | ||
*/ | ||
|
@@ -102,7 +102,7 @@ protected function decodeData(string $input) | |
throw new RuntimeException('Invalid RLP.'); | ||
} | ||
$length = hexdec($hexLength); | ||
$data = mb_substr($input, $llength * 2, ($length + $llength - 1) * 2); | ||
$data = mb_substr($input, $llength * 2, $length * 2); | ||
|
||
if (mb_strlen($data) < $length * 2) { | ||
throw new RuntimeException('Invalid RLP.'); | ||
|
@@ -159,7 +159,7 @@ protected function decodeData(string $input) | |
|
||
/** | ||
* encodeLength | ||
* | ||
* | ||
* @param int $length | ||
* @param int $offset | ||
* @return string | ||
|
@@ -176,7 +176,7 @@ protected function encodeLength(int $length, int $offset) | |
|
||
/** | ||
* intToHex | ||
* | ||
* | ||
* @param int $value | ||
* @return string | ||
*/ | ||
|
@@ -189,7 +189,7 @@ protected function intToHex(int $value) | |
|
||
/** | ||
* padToEven | ||
* | ||
* | ||
* @param string $value | ||
* @return string | ||
*/ | ||
|
@@ -222,4 +222,4 @@ protected function encodeInput($input) | |
} | ||
throw new InvalidArgumentException('The input type didn\'t support.'); | ||
} | ||
} | ||
} |