Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
In the course of my day job, I needed to add base58 support but could not use the
bcmath
orgmp
modules. To support that I wrote a pure PHP service.To work with our environment I had to make a couple of changes to support PHP 7.2
Deficiencies
I'm aware it has (at least) the following issues:
PHPService
updates from PHP 7.2 compatibility updatesbut I wanted to get discussion started so I can avoid repeating any other mistakes I have made
Performance
According to the included benchmarks, on my machine the pure PHP implementation is actually faster than the
bcmath
implementation:I have an idea that this is at least partially because I do a direct base change from 256 to 58, while the included services do 256->10->58 instead. I envision experimenting with altering the
bcmath
andgmp
algorithms similarly to see if they also speed up.