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
Imagine a use-case where someone would like to maintain a rolling CRC digest, while also regularly reading the sum of that CRC digest via the equivalent of calling finalize. This is a common pattern used by write ahead logs where you want to maintain a rolling CRC of all the data written to the log, while also embedding the rolling finalized value in each of the records written to disk.
As far as I can tell, the current APIs are not compatible with this use-case:
The higher-level Digest struct's finalize method unnecessarily consumes itself via it's self receiver, disallowing the interleaving of multiple calls to update and finalize.
The lower level Crc structs don't make update or finalize public, disallowing consumes to write their own version of Digest that allows the interleaving of multiple calls to update and finalize.
A workaround might be to clone the Digest before calling finalize which seems inefficient.
Any thoughts on this use-case and the best way to unlock it?
The text was updated successfully, but these errors were encountered:
Imagine a use-case where someone would like to maintain a rolling CRC digest, while also regularly reading the sum of that CRC digest via the equivalent of calling
finalize
. This is a common pattern used by write ahead logs where you want to maintain a rolling CRC of all the data written to the log, while also embedding the rolling finalized value in each of the records written to disk.As far as I can tell, the current APIs are not compatible with this use-case:
Digest
struct'sfinalize
method unnecessarily consumes itself via it'sself
receiver, disallowing the interleaving of multiple calls toupdate
andfinalize
.Crc
structs don't makeupdate
orfinalize
public, disallowing consumes to write their own version ofDigest
that allows the interleaving of multiple calls toupdate
andfinalize
.A workaround might be to clone the Digest before calling
finalize
which seems inefficient.Any thoughts on this use-case and the best way to unlock it?
The text was updated successfully, but these errors were encountered: