Skip to main content

Module hash

Module hash 

Source
Expand description

TypeIdentifier hash computation (XTypes 1.3 §7.3.1.2).

The EquivalenceHash (14 bytes) is formed from the first 14 bytes of the MD5 digest over the XCDR2-serialized TypeObject representation (XTypes 1.3 §7.3.1.2.1):

EquivalenceHash(T) := MD5(xcdr2_le_bytes(T))[0..14]

Cyclone DDS and Fast-DDS use MD5 — hence mandatory for live interop.

  • For MinimalTypeObject T: EK_MINIMAL hash
  • For CompleteTypeObject T: EK_COMPLETE hash

From the hash a TypeIdentifier of kind EK_MINIMAL resp. EK_COMPLETE is built — this is the “strongly-hashed” form of the TypeObject, as exchanged between peers via SEDP (PID_TYPE_INFORMATION) and the TypeLookup service.

Functions§

complete_hash_input
The exact byte stream fed to MD5 for a CompleteTypeObject hash.
compute_complete_hash
Like compute_minimal_hash, only for CompleteTypeObject.
compute_hash
Computes the 14-byte EquivalenceHash of a TypeObject.
compute_minimal_hash
Like compute_hash, but directly over MinimalTypeObject (without the EquivalenceKind discriminator wrapper clone). Writes the EK_MINIMAL discriminator before the body itself.
hash_bytes
Raw hash function: MD5 + truncate to 14 bytes.
minimal_hash_input
The exact byte stream fed to MD5 for a MinimalTypeObject hash (XCDR2 DHEADER + EK + body). Exposed so conformance harnesses can byte-diff it against vendor TypeObject goldens.
to_hashed_type_identifier
Shortcut: builds a strongly-hashed TypeIdentifier from a TypeObject. Wraps compute_hash in the matching EquivalenceHash* TypeIdentifier variant depending on Minimal/Complete.