segment_hash -> tictac

the concept of the segment hash belongs to the leveled_tictac module, not the codec.

Previously the alignment of tictac and store was accidental, this change makes it explicit.
This commit is contained in:
Martin Sumner 2018-03-22 19:03:52 +00:00
parent 6ce903ad2b
commit b81caf7dee
2 changed files with 15 additions and 4 deletions

View file

@ -92,8 +92,7 @@
%% 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>> =
crypto:hash(md5, Key),
{segment_hash, SegmentID, ExtraHash} = leveled_tictac:keyto_segment48(Key),
{SegmentID, ExtraHash};
segment_hash({?RIAK_TAG, Bucket, Key, null})
when is_binary(Bucket), is_binary(Key) ->