Skip to content

Conversation

@aditya-subrahmanyan
Copy link

Which issue does this PR close?

What changes are included in this PR?

The spec states that:

"Decimal values are hashed using the minimum number of bytes required to hold the unscaled value as a two's complement big-endian".

Prior to this fix, we would incorrectly consume leading 0xFF bytes and hash them. Now, we only consume the bytes starting with the one that is used to preserve the sign, and everything that follows it.

Are these changes tested?

Added unit tests for original scenario mentioned in the issue, as well as some additional cases

Spec states that: "Decimal values are hashed using the minimum number of
bytes required to hold the unscaled value as a two's complement
big-endian".

Prior to this fix, we would incorrectly consume leading 0xFF bytes and
hash them. Now, we only consume the bytes starting with the one that is
used to preserve the sign, and everything that follows that byte.
@aditya-subrahmanyan aditya-subrahmanyan marked this pull request as ready for review January 6, 2026 06:31
@aditya-subrahmanyan
Copy link
Author

Hi @liurenjie1024 @Xuanwo @Fokko. Could you please review this PR and let me know if the fix makes sense? Thanks!

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.

bucket[N] transform computes incorrect hash for decimal values

1 participant