Fletcher32: Add incremental API#19981
Conversation
77ec405 to
6c89129
Compare
Teufelchen1
left a comment
There was a problem hiding this comment.
Only minor remarks by me and one static-test! 💪
|
... 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_u16to 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