Skip to content

Commit

Permalink
bcmod cast to int for compatibility php 72
Browse files Browse the repository at this point in the history
  • Loading branch information
merbaum committed Aug 22, 2019
1 parent d6714d5 commit 2c8cbe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BCMathService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function encode($string)
$output = '';
while ($decimal >= $this->base) {
$div = bcdiv($decimal, $this->base, 0);
$mod = bcmod($decimal, $this->base);
$mod = (int) bcmod($decimal, $this->base);
$output .= $this->alphabet[$mod];
$decimal = $div;
}
Expand Down Expand Up @@ -146,7 +146,7 @@ public function decode($base58)
// Convert from base10 to base256 (8-bit byte array)
$output = '';
while ($decimal > 0) {
$byte = bcmod($decimal, 256);
$byte = (int) bcmod($decimal, 256);
$output = pack('C', $byte) . $output;
$decimal = bcdiv($decimal, 256, 0);
}
Expand Down

0 comments on commit 2c8cbe6

Please sign in to comment.