Skip to content

Commit

Permalink
Merge pull request #345 from web3p/patch-tohex-for-string
Browse files Browse the repository at this point in the history
Remove strip zero when encode string to hex
  • Loading branch information
sc0Vu authored Feb 1, 2024
2 parents c58212a + 51e2222 commit 1e6213d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public static function toHex($value, $isPrefix=false)
$hex = $bn->toHex(true);
$hex = preg_replace('/^0+(?!$)/', '', $hex);
} elseif (is_string($value)) {
$value = self::stripZero($value);
$hex = implode('', unpack('H*', $value));
} elseif ($value instanceof BigNumber) {
$hex = $value->toHex(true);
Expand Down

0 comments on commit 1e6213d

Please sign in to comment.