apoc.hashing.fingerprint

Details

Syntax

apoc.hashing.fingerprint(object [, excludedPropertyKeys ])

Description

Calculates a MD5 checksum over a NODE or RELATIONSHIP (identical entities share the same checksum). Unsuitable for cryptographic use-cases.

Arguments

Name

Type

Description

object

ANY

A node or relationship to hash.

excludedPropertyKeys

LIST<STRING>

Property keys to exclude from the hashing. The default is: [].

Returns

STRING

Usage Examples

The examples in this section are based on the following sample graph:

MERGE (joe:Person {name: "Joe"})
MERGE (ryan:Person {name: "Ryan"})
MERGE (ryan)-[:FOLLOWS {since: datetime("2020-11-04")}]->(joe);
MATCH (person:Person {name: "Ryan"})
RETURN apoc.hashing.fingerprint(person) AS output;
Results
output

"81C99DD6C9382C4E01A1873F9E818CE0"

MATCH ()-[rel:FOLLOWS]->()
RETURN apoc.hashing.fingerprint(rel) AS output;
Results
output

"C5A4B9FA273CC723D96BF93FFDD42858"

RETURN apoc.hashing.fingerprint({name: "Michael"}) AS output;
Results
output

"F582CEF35FA83F3691BB756313191948"

If we want more control over fingerprint generation, see apoc.hashing.fingerprinting.