10.15. Fingerprinting

The following functions do calculate hashsums over nodes, relationship or the entire graph. It takes into account all properties, node labels and relationship types.

be aware that the algorithm used for hashing might be changed from one apoc version to another. So you can only compare hashing results of two entities/graphs from the same or from different graph using the very same apoc version.

The hashsum of a graph first calculates the hashsums for each node. This hashsum list is ordered and for each node the hashsum for all relationships and their endnode are added. This approach provides independence of internal ids.

Optionally you can supply a list of propertyKeys that should be ignored on all nodes. This is, e.g. useful if you store created=timestamp() properties that should be ignored.

function name description

apoc.hashing.fingerprint(object, <list_of_props_to_ignore>)

calculates a md5 hashsum over the object. It deals gracefully with ordering (in case of maps), scalars, arrays.

apoc.hashing.graph(<list_of_props_to_ignore>)

calculates a md5 hashsum over the full graph.