util_module
The util module offers a range of functions for tasks such as validation and creating cryptographic hash values. This module serves as a practical resource for streamlining a variety of tasks related to database operations.
Trait | Value |
---|---|
Module type | util |
Implementation | C++ |
Graph direction | directed/undirected |
Edge weights | weighted/unweighted |
Parallelism | sequential |
Procedures
md5(values)
Gets the string representation of every element in the input list, concatenates it into a single string, and returns the md5 hash of that string.
NOTE: The format of string representations can be seen by checking ToString
in C++ API documentation for desired type or Value.
Input:
values: List[Any]
➡ input list containing elements which can be any of Memgraph's data types.
Output:
result: string
➡ resulting md5 hash returned as string.
Usage:
NOTE: The hash provided in this documentation will be different from the user's hash for the same input unless the node has the same ID because Node.ToString()
uses the node's ID in string formation, so different IDs equal different strings, hence, different hashes.
CREATE (d:Dog);
MATCH (d:Dog)
CALL util_module.md5([d, "string", 50]) YIELD result RETURN result;
+-----------------------------------+
| result |
+-----------------------------------+
| 47e656a5f446fc21316e97df90e8ae33 |
+-----------------------------------+