Skip to content
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

Returns a different result on a 32-bit platform vs 64-bit #25

Open
romanrm opened this issue Apr 5, 2024 · 3 comments
Open

Returns a different result on a 32-bit platform vs 64-bit #25

romanrm opened this issue Apr 5, 2024 · 3 comments

Comments

@romanrm
Copy link

romanrm commented Apr 5, 2024

With a code like this:

echo Tuupola\Base85Proxy::encode(md5("test", true)), "\n";

amd64:

$'/lH7Np6%b2,mG-7?1o

armv7el:

$'/lH7Np6%epLbF-7?1o

PHP 7.4 on both.

--
Just reported a similar bug to another base85 package: scottchiefbaker/php-base85#2
that one has a more severe problem. "unpack" is problematic on 32-bit vs 64-bit, yours almost works, but also couldn't escape it.

@tuupola
Copy link
Owner

tuupola commented Apr 5, 2024

I wonder which result is correct. I would guess the 64-bit one.

@tuupola
Copy link
Owner

tuupola commented Apr 5, 2024

Might also be related to this: #7

@romanrm
Copy link
Author

romanrm commented Apr 5, 2024

Yes the 64-bit value is correct.
See some investigation on the other bug report, and some suggestions in PHP doc comments:
scottchiefbaker/php-base85#2 (comment)
https://www.php.net/manual/en/function.unpack.php#106041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants