anchor.diff:              lists:usort(Nodes)
       end.
   
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% Get key used to choose node.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec get_hashing_key(term()) -> term().
  -get_hashing_key(Label) when is_binary(Label) ->
  -    case split_hash(Label) of
  -        {undefined, _} ->
  -            % Label does not contain hash part - generate key from label's random part
  -            Len = byte_size(Label),
  -            binary:part(Label, Len, -1 * min(?HASH_LENGTH, Len));
  -        {Hash, _} -> Hash
  -    end;
  -get_hashing_key(Label) ->
  -    Label.
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% Get random part of label.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec get_random_label_part(term()) -> term().
  -get_random_label_part(Label) when is_binary(Label) ->
  -    {_, Random} = split_hash(Label),
  -    Random;
  -get_random_label_part(Label) ->
  -    Label.
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% Generates random hashing key.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec gen_hashing_key() -> binary().
  -gen_hashing_key() ->
  -    str_utils:rand_hex(?HASH_LENGTH).
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% Verifies whether Label has hash part (part used to choose node) defined.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec has_hash_part(term()) -> boolean().
  -has_hash_part(Label) when is_binary(Label) ->
  -    {Hash, _} = split_hash(Label),
  -    Hash =/= undefined;
  -has_hash_part(_Label) ->
  -    false.
  -
  -%%--------------------------------------------------------------------
  -%% @doc
  -%% Creates label with part used to choose node.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec create_label(binary(), binary()) -> binary().
  -create_label(HashPart, RandomPart) ->
  -    <<RandomPart/binary, ?HASH_SEPARATOR, HashPart/binary>>.
  -
   %%%===================================================================
   %%% Internal functions
   %%%===================================================================
  -
  -%%-------------------------------------------------------------------
  -%% @private
  -%% @doc
  -%% Gets part of the label used to choose node.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec split_hash(binary()) -> {binary() | undefined, binary()}.
  -split_hash(Label) ->
  -    case binary:split(Label, ?HASH_SEPARATOR_BIN) of
  -        [RandomPart, Hash | _] ->
  -            {binary:part(Hash, 0, min(?HASH_LENGTH, byte_size(Hash))), RandomPart};
  -        _ ->
  -            {undefined, Label}
  -    end.
   
   %%--------------------------------------------------------------------
   %% @doc
  
positive.code:         Node when ?IS_SINGLE_NODE_CHASH(Node) ->
              Node;
          CHash ->
              Index = chash:key_of(get_hashing_key(Label)),
              [{_, BestNode}] = chash:successors(Index, CHash, 1),
              BestNode
      end.
  
negative.code:         Node when ?IS_SINGLE_NODE_CHASH(Node) ->
              [Node];
          CHash ->
              Index = chash:key_of(Label),
              lists:map(fun({_, Node}) -> Node end, chash:successors(Index, CHash, NodesNum))
      end.
  
  