ewokscore.hashing.UniversalHashable#

class ewokscore.hashing.UniversalHashable(pre_uhash=None, instance_nonce=None)[source]#

Bases: HasUhash

The universal hash of an instance of this class is based on:

  • pre-uhash

  • instance nonce (if any)

The universal hash is equal to the pre-hash when an instance nonce is not provided.

The pre-uhash is either provided or based on:

  • data

  • class nonce (class qualifier name, class version, superclass nonce)

Parameters:
MISSING_DATA = <MISSING_DATA>#
classmethod class_nonce()[source]#
classmethod class_nonce_data()[source]#
cleanup_references()[source]#

Remove all references to other hashables. Side effect: fixes the uhash when it depends on another hashable.

fix_uhash()[source]#

Fix the uhash when it is derived from the uhash data.

get_uhash_init(serialize=False)[source]#
instance_nonce()[source]#
set_uhash_init(pre_uhash=None, instance_nonce=None)[source]#
Parameters:
property uhash: UniversalHash | None#
uhash_randomize()[source]#
undo_fix_uhash()[source]#
undo_randomize()[source]#