Skip to content

← programming package

Hash

Compute a hash of a given piece of data.

The resulting code can be used to index content-addressable data structures such as caches. None inputs can be subjected to special handling, as per the none_handling port. The running time of this operation is proportional to the complexity and size of the object. Note that the hash is not guaranteed to be stable across different versions of NeuroPype. For certain object types, including nodes (particularly those with state), graphs, and general objects, the hash may also be unstable across different runs of the same version of NeuroPype. More Info... Version 1.0.0

Ports/Properties

data

Data to hash.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: object (can be None)
  • data direction: IN

hash

Hash code of the data.

  • verbose name: Hash
  • default value: None
  • port type: DataPort
  • value type: int (can be None)
  • data direction: OUT

none_handling

What to do when the input is None. If "hash", None will be hashed like any other value. If "passthrough", None will be emitted. If "error", an exception will be raised.

  • verbose name: None Handling
  • default value: hash
  • port type: EnumPort
  • value type: str (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)