From e66e326c2bfb4696b4fc6244fa2b6b808c55c978 Mon Sep 17 00:00:00 2001 From: martinsumner Date: Tue, 30 May 2017 16:50:23 +0100 Subject: [PATCH] Dialyzer help Add specs and docs --- src/leveled_tinybloom.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/leveled_tinybloom.erl b/src/leveled_tinybloom.erl index 23ff343..9d0ae32 100644 --- a/src/leveled_tinybloom.erl +++ b/src/leveled_tinybloom.erl @@ -25,7 +25,9 @@ %%% API %%%============================================================================ - +-spec create_bloom(list(integer())) -> binary(). +%% @doc +%% Create a binary bloom filter from alist of hashes create_bloom(HashList) -> case length(HashList) of 0 -> @@ -41,6 +43,9 @@ create_bloom(HashList) -> add_hashlist(HashList, 1, 0, 0) end. +-spec check_hash(integer(), binary()) -> boolean(). +%% @doc +%% Check for the presence of a given hash within a bloom check_hash(_Hash, <<>>) -> false; check_hash(Hash, BloomBin) ->