-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fletcher32: Add incremental API #19981
Conversation
77ec405
to
6c89129
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor remarks by me and one static-test! 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦐
... waiting for users passing in byte array length as "words" ... |
The whole api of this module has in my opinion always been a huge footgun. Any suggestions here? |
ba5314a
to
71da3f4
Compare
Agreed. Now that there's a struct with state, buffer single bytes there if necessary? |
... but of course I don't want to hold up the already ACK'ed PR. |
|
Feel free to squash |
1257420
to
a00702e
Compare
Squashed! |
bors merge |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Contribution description
This PR extends the current fletcher32 checksum with an incremental API mode. This way the bytes to be checksummed can be supplied via multiple successive calls and do not have to be provided in a single consecutive buffer.
I've also rephrased the warning with the original function a bit as that function uses an
unaligned_get_u16
to access the data. The data thus does not require alignment, but the length does need to be supplied as number of 16 bit words.Testing procedure
The test has been extended
Issues/PRs references
None