Closed brianrlewis closed 3 years ago
On average calls to $magic->token->validate() took about 17ms with gmp versus 320ms with bcmath. In apps where validate is being called on every request this may be a showstopper for some users.
Thank you for sharing it!
Users should be encouraged to install gmp whenever possible, but also made aware that the package will work with bcmath as an alternative. Currently there are various hosting platforms that do not support gmp, like Laravel Vapor for example.
Agreed. Wondering if we should update https://github.com/magiclabs/magic-admin-php#dependencies section to reflect that.
Users should be encouraged to install gmp whenever possible, but also made aware that the package will work with bcmath as an alternative. Currently there are various hosting platforms that do not support gmp, like Laravel Vapor for example.
Agreed. Wondering if we should update https://github.com/magiclabs/magic-admin-php#dependencies section to reflect that.
Yes, that is a good idea. I just pushed an update to the readme.
📦 Pull Request
This pull implements an alternate ecRecover process internally as opposed to using digitaldonkey/ecverify. This is due to the reasons described in this issue. In summary this pull will allow this package to support runtimes that do not have the
gmp
extension installed as long as thebcmath
extension is installed.No new functionality has been introduced.
One thing to note is that although calls to
$magic->token->validate()
will work withoutgmp
as long asbcmath
is installed, there is a significant performance difference between the two. This is why the simplito/bigint-wrapper-php sub-dependency is designed to work withgmp
first andbcmath
as a fallback.On average calls to
$magic->token->validate()
took about 17ms withgmp
versus 320ms withbcmath
. In apps where validate is being called on every request this may be a showstopper for some users.Users should be encouraged to install
gmp
whenever possible, but also made aware that the package will work withbcmath
as an alternative. Currently there are various hosting platforms that do not supportgmp
, like Laravel Vapor for example.🗜 Versioning
(Check one!)