From a02a0cc86ccc2ca3e05a57debc34ac47379cf3ea Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Wed, 4 Mar 2026 00:48:10 -0300 Subject: generalize constraints in membership with quantification --- src/operations.erl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/operations.erl') diff --git a/src/operations.erl b/src/operations.erl index 8773e0e..de61fd8 100644 --- a/src/operations.erl +++ b/src/operations.erl @@ -41,6 +41,7 @@ -include("../include/operations.hrl"). -export([ create_database/1, + value_hash/1, create_relation/3, create_immutable_relation/2, update_relation_constraints/3, @@ -87,6 +88,17 @@ hash(Value) -> crypto:hash(sha256, term_to_binary(Value)). +%% @doc Hash a value using Sakura's canonical content hash. +%% +%% Public wrapper around the internal hash function, used by other modules +%% that need to compare values against stored attribute hashes. +%% +%% @param Value Any Erlang term +%% @returns Binary SHA-256 hash +-spec value_hash(term()) -> binary(). +value_hash(Value) -> + hash(Value). + %% @doc Insert a tuple into a relation and update the database state. %% %% This is the primary operation for adding data to the database. It: -- cgit v1.2.3