You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Installations without GMP fall back to using PHP's native base_convert function which isn't designed to handle very large inputs like SHA3-512. The resulting ID values have an odd-looking pattern to them (note the amount of 0's, 4's and 8's for example):
Thanks for the quick response! By the way, I ran into this mainly because Laravel Sail doesn't include GMP by default. Would you ever consider the idea of using phlib/base_convert (or some other userland implementation) as a fallback? I'm guessing the main reason not to would be the giant performance hit, but for dev environments it might be an acceptable tradeoff. Up to you really.
For libraries such as this, I prefer they have no external dependencies (if it can be helped). With that said I also do not like to impose a requirement on a non-default PHP extension either which is why GMP was originally optional but obviously it is unavoidable given the bug, hence the new release making it required.
I did look at phplib/base_convert but unfortunately, it's licensed under GPL (of which I am not a fan). If I find a viable alternative that is either MIT or Apache-2 licensed, I will make the GMP extension requirement optional again.
Installations without GMP fall back to using PHP's native base_convert function which isn't designed to handle very large inputs like SHA3-512. The resulting ID values have an odd-looking pattern to them (note the amount of 0's, 4's and 8's for example):
bg48okgw0wwooo0g0488s4so
egcs480os8gkk84sgkgcgks8
fc00w044cckow4ock4s0w0sw
iw8ogk8woowk0cw8c8kgoscw
k40040s4kcsgsk0wg8scks8o
pwgo80o4c4kogk4gcs8oko8k
r8000cc8ggcsw0s8s44s440w
uc8gk8gog04wc044k4ck4s8c
zokgk80ww4o0sksws8s44osc
zwowwk4sc40c00ws44ww0gso
The issue is even noticeable in the example IDs shown in the readme 😄
When GMP is installed this issue goes away, but it should probably be made much clearer that GMP is needed for this library to work correctly.
Alternatively the dependency on GMP could be replaced with the library
phlib/base_convert
which seems to get the job done.The text was updated successfully, but these errors were encountered: