diff --git a/src/RLP.php b/src/RLP.php index 5eb6b14..c17662c 100644 --- a/src/RLP.php +++ b/src/RLP.php @@ -2,9 +2,9 @@ /** * This file is part of rlp package. - * + * * (c) Kuan-Cheng,Lai - * + * * @author Peter Lai * @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.'); } -} \ No newline at end of file +}