parent
3fd5260cd9
commit
29a2d9fc35
2 changed files with 96 additions and 44 deletions
|
@ -83,12 +83,12 @@
|
|||
|
||||
-spec segment_hash(any()) -> {integer(), integer()}.
|
||||
%% @doc
|
||||
%% Return two integers - the segment ID and a second integer for spare
|
||||
%% Return two 16 bit 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:32/integer, _Rest/binary>> =
|
||||
<<SegmentID:16/integer, ExtraHash:16/integer, _Rest/binary>> =
|
||||
crypto:hash(md5, Key),
|
||||
{SegmentID, ExtraHash};
|
||||
segment_hash(Key) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue