Allow saving and resuming from hash state #1123

Open
opened 2026-08-05 19:42:23 -05:00 by crass · 0 comments
crass commented 2026-08-05 19:42:23 -05:00 (Migrated from github.com)

It would be useful to allow serializing the state of a running hash to be deserialized at a later time and resume adding to the hash state as if no serialization had happened (see this and this).

Perhaps some functions could be added to the public API to allow for de/serializing a running hash. Considering that XXH3_state_s hasn't changed in 6 years, it seems probable that its pretty stable. So perhaps versioning doesn't need to be a concern.

It would be useful to allow serializing the state of a running hash to be deserialized at a later time and resume adding to the hash state as if no serialization had happened (see [this](https://github.com/ifduyue/python-xxhash/issues/24) and [this](https://github.com/martinus/oans/issues/159#issuecomment-5195257123)). Perhaps some functions could be added to the public API to allow for de/serializing a running hash. Considering that `XXH3_state_s` hasn't [changed in 6 years](https://github.com/Cyan4973/xxHash/blame/c0b5ea995d66691734b1a79ad89e73a0d2fd5a53/xxhash.h#L1765-L1792), it seems probable that its pretty stable. So perhaps versioning doesn't need to be a concern.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Cyan4973/xxHash#1123
No description provided.