diff options
author | nagachika <nagachika@ruby-lang.org> | 2022-05-05 19:18:37 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2022-05-05 19:18:37 +0900 |
commit | e87640cd9d3dfe2cad004224eb356ee406865c8a (patch) | |
tree | f7fce5472896db925934bea98b25b717b0aa41da /test | |
parent | 5a578f10aef8c0935090ea8d4e66c7ad3094fc18 (diff) |
merge revision(s) 1cbdedec895070df1df96d05370cf8da084ab6fa:
[ruby/zlib] Mask checksums to lower 32bits
Upper bits affect the result of `crc32` in zlib 1.2.12.
https://github.com/ruby/zlib/commit/9ab6d04af1
---
ext/zlib/zlib.c | 12 +++++++++---
test/zlib/test_zlib.rb | 2 ++
2 files changed, 11 insertions(+), 3 deletions(-)
Diffstat (limited to 'test')
-rw-r--r-- | test/zlib/test_zlib.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 1e57c5aa8c..a57e1fcb26 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -1303,6 +1303,7 @@ if defined? Zlib assert_equal(0x02820145, Zlib.adler32("foo")) assert_equal(0x02820145, Zlib.adler32("o", Zlib.adler32("fo"))) assert_equal(0x8a62c964, Zlib.adler32("abc\x01\x02\x03" * 10000)) + assert_equal(0x97d1a9f7, Zlib.adler32("p", -305419897)) Tempfile.create("test_zlib_gzip_file_to_io") {|t| File.binwrite(t.path, "foo") t.rewind @@ -1338,6 +1339,7 @@ if defined? Zlib assert_equal(0x8c736521, Zlib.crc32("foo")) assert_equal(0x8c736521, Zlib.crc32("o", Zlib.crc32("fo"))) assert_equal(0x07f0d68f, Zlib.crc32("abc\x01\x02\x03" * 10000)) + assert_equal(0xf136439b, Zlib.crc32("p", -305419897)) Tempfile.create("test_zlib_gzip_file_to_io") {|t| File.binwrite(t.path, "foo") t.rewind |