Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Bilal2453
Copy link
Contributor

@Bilal2453 Bilal2453 commented Aug 20, 2024

Using the default value for the first parameter of lminiz.adler32 will output invalid checksum due to improper defaults.

For example:

local miniz = requrie("miniz")
miniz.adler32(nil, "luvit") --> 110625332

Which is wrong, it should instead be 110953013 (0x069D0235).
For reference take the output of an online calculatore like this one or even the Wikipedia example.

An Adler32 checksum is 32-bit number made of two 16-bit groups A and B, group A should initiate with 1 and group B should initiate with 0. Currently by default group A will default to 0 instead of 1.

@zhaozg Is this right?

@Bilal2453
Copy link
Contributor Author

Failed tests are unrelated.
@truemedian Seems like the QEMU-based tests are failing due to a fetching error (404).

@zhaozg zhaozg merged commit eb1d7c9 into luvit:master Aug 20, 2024
@Bilal2453 Bilal2453 deleted the lminiz-adler32-default branch August 20, 2024 10:12
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

Successfully merging this pull request may close these issues.

2 participants