apoc.hashing.fingerprint

Function

apoc.hashing.fingerprint(object ANY, excludedPropertyKeys LIST<STRING>) - calculates a MD5 checksum over a NODE or RELATIONSHIP (identical entities share the same checksum). Unsuitable for cryptographic use-cases.

Signature

apoc.hashing.fingerprint(some object :: ANY, propertyExcludes = [] :: LIST<STRING>) :: STRING

Input parameters

Name Type Default

some object

ANY

null

propertyExcludes

LIST<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;
Table 1. Results
output

"81C99DD6C9382C4E01A1873F9E818CE0"

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

"C5A4B9FA273CC723D96BF93FFDD42858"

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

"F582CEF35FA83F3691BB756313191948"

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