-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Illegal string offset exception in BCMathService.php #17
Comments
Edit: I see this issue has been posted already. My bad. |
Hi Joel This library does encode strings. I have seen this issue before, but have never been able to replicate it myself. I get the following when testing the string you are trying to encode: $b = new StephenHill\Base58();
$b->encode('0248ac9d3652ccd8350412b83cb08509e7e4bd41');
// Encodes to "3PtvAWwSMPe2DohNuCFYy76JhMV3rhxiSxQMbPBTtiPvYvneWu95XaY"
$b->decode('3PtvAWwSMPe2DohNuCFYy76JhMV3rhxiSxQMbPBTtiPvYvneWu95XaY');
// Decodes to "0248ac9d3652ccd8350412b83cb08509e7e4bd41" What version of PHP are you using? What processor are you using? Cheers |
It fails with PHP 5.5.11 on Apache (bundled with XAMPP), but works fine on PHP 5.6.10 on the CLI. Switching from BCMath to GMP on Apache's PHP seems to fix the issue though. |
I believe I've found the problem with the BCMath service. I'll write some unit tests tonight and hopefully provide a v1.1.4 patch. |
I believe I have fixed this in release v1.1.4. I would be grateful if you could update to the latest version and let me know if it fixes your original error. Many Thanks |
Here's the error:
On line 91:
$output .= $this->alphabet[$decimal];
Since
$decimal
is a float, the above line won't work.The text was updated successfully, but these errors were encountered: