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

Adler32 isn't initialized correctly #66

Open
ehrmann opened this issue Aug 7, 2016 · 0 comments
Open

Adler32 isn't initialized correctly #66

ehrmann opened this issue Aug 7, 2016 · 0 comments

Comments

@ehrmann
Copy link

ehrmann commented Aug 7, 2016

The code that calls out to the adler32 implementation uses an initial value of 0, not 1, so it won't be compatible with other adler32 implementations (though there are workarounds).

The easiest way to verify is computing an empty checksum:

printf("Empty adler32: %llu\n", ComputeAdler32("", 0));

Compare this to Java or Python's implementations. Or the spec (see "Appendix: Sample code").

Fixing this with a breaking change is probably more trouble than it's worth; there's enough deltas out there that it would cause people problems, and this shouldn't(?) affect the quality of the checksum since 0 is a valid adler32 value, but it'd be a good idea to document it somewhere.

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

1 participant