autointent.Hasher#
- class autointent.Hasher#
A class that provides methods for hashing data using xxhash.
This class supports both a class-level method for generating hashes from any given value, as well as an instance-level method for progressively updating a hash state with new values.
- classmethod hash(value)#
Generate a hash for the given value using xxhash.
- Parameters:
value (Any) – The value to be hashed. This can be any Python object.
- Returns:
The resulting hash digest as a hexadecimal string.
- Return type:
- update(value)#
Update the internal hash state with the provided value.
This method will first hash the type of the value, then hash the value itself, and update the internal state accordingly.
- Parameters:
value (Any) – The value to update the hash state with.
- Return type:
None
- hexdigest()#
Return the current hash digest as a hexadecimal string.
This method should be called after one or more update calls to get the final hash result.
- Returns:
The resulting hash digest as a hexadecimal string.
- Return type: