From 2c9b00a53b598ad1d07fb4e6d950eed90c295dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Go=C5=82dyn?= Date: Wed, 27 Jun 2018 22:57:58 +0200 Subject: [PATCH] Fix base58check_encode function by using intval() function to convert argument to integer (if it is string). Otherwise notice occurs: A non well formed numeric value encountered --- src/CryptoCoin/CoinAddress.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CryptoCoin/CoinAddress.php b/src/CryptoCoin/CoinAddress.php index 1baeb38..54f1023 100644 --- a/src/CryptoCoin/CoinAddress.php +++ b/src/CryptoCoin/CoinAddress.php @@ -399,10 +399,10 @@ public static function create_key_pair() public static function base58check_encode($leadingByte, $bin, $trailingByte = null) { - $bin = chr($leadingByte) . $bin; + $bin = chr(intval($leadingByte)) . $bin; if ($trailingByte !== null) { - $bin .= chr($trailingByte); + $bin .= chr(intval($trailingByte)); } $checkSum = substr(hash('sha256', hash('sha256', $bin, true), true), 0, 4); $bin .= $checkSum;