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
{{ message }}
Repository navigation
Document that StreamingXXHash32.asChecksum() returns only 28 bits #115
StreamingXXHash32.java:106 returns getValue() & 0xFFFFFFFL. The mask has been there since 2013 (c2d417e). LZ4BlockOutputStream/LZ4BlockInputStream use this Checksum by default, so the LZ4Block on-wire checksum is truncated to 28 bits. Other implementations of the format (e.g. Netty) reproduce this, so changing the behaviour would break the wire format.
Don't change the behaviour. Instead:
Javadoc on asChecksum(): for compatibility with the LZ4Block format, getValue() returns only the low 28 bits. Use StreamingXXHash32.getValue() for the full hash.
Mention the 28-bit mask in the format description of LZ4BlockOutputStream.
Optionally write the constant as 0x0FFFFFFFL and add a test that pins the value.
Activity
Document that StreamingXXHash32.asChecksum() returns only 28 bits