apoc.hashing.fingerprintGraph

Function APOC Core

calculate a checksum (md5) over a the full graph. Be aware that this function does use in-memomry datastructures depending on the size of your graph. MD5 is a weak hashing algorithm which is unsuitable for cryptographic use-cases.

Signature

apoc.hashing.fingerprintGraph(propertyExcludes = [] :: LIST? OF STRING?) :: (STRING?)

Input parameters

Name Type Default

propertyExcludes

LIST? OF 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);

This function computes a fingerprint of the whole graph using the MD5 checksum:

RETURN apoc.hashing.fingerprintGraph() AS output;
Table 1. Results
output

"655408F901B554A8999AEF61EA6D5AE5"

We can pass in a list of properties to exclude from the fingerprint, as shown in the following query:

RETURN apoc.hashing.fingerprintGraph(["since"]) AS output;
Table 2. Results
output

"0583812D25093B4CD03C96DF15215048"