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

Implement ContentHash for u32 and u64 #3065

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Implement ContentHash for u32 and u64 #3065

merged 1 commit into from
Feb 16, 2024

Conversation

emesterhazy
Copy link
Contributor

This is for completeness and to avoid accidents such as someone calling ContentHash::hash(1234u32.to_le_bytes()) and expecting it to hash properly as a u32 instead of a 4 byte slice, which produces a different hash due to hashing the length of the slice before its contents.

@emesterhazy emesterhazy requested a review from yuja February 16, 2024 14:36
This is for completeness and to avoid accidents such as someone calling
`ContentHash::hash(1234u32.to_le_bytes())` and expecting it to hash properly as
a u32 instead of a 4 byte slice, which produces a different hash due to hashing
the length of the slice before its contents.
Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@emesterhazy emesterhazy merged commit a80d018 into main Feb 16, 2024
15 checks passed
@emesterhazy emesterhazy deleted the push-movssuxutxyx branch February 16, 2024 15:23
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