Use lower fpr tinyblooms

... but maybe they're slower?
This commit is contained in:
Martin Sumner 2017-10-24 15:15:15 +01:00
parent 26aa573ce1
commit 3fd5260cd9
2 changed files with 44 additions and 96 deletions

View file

@ -83,12 +83,12 @@
-spec segment_hash(any()) -> {integer(), integer()}.
%% @doc
%% Return two 16 bit integers - the segment ID and a second integer for spare
%% Return two integers - the segment ID and a second integer for spare
%% entropy. The hashed should be used in blooms or indexes such that some
%% speed can be gained if just the segment ID is known - but more can be
%% gained should the extended hash (with the second element) is known
segment_hash(Key) when is_binary(Key) ->
<<SegmentID:16/integer, ExtraHash:16/integer, _Rest/binary>> =
<<SegmentID:16/integer, ExtraHash:32/integer, _Rest/binary>> =
crypto:hash(md5, Key),
{SegmentID, ExtraHash};
segment_hash(Key) ->