Commits

Anonymous committed bd97361

shorter client ids in vclocks

  • Participants
  • Parent commits 1f04921

Comments (0)

Files changed (1)

src/riak_util.erl

 mkclientid(RemoteNode) ->
     {{Y,Mo,D},{H,Mi,S}} = erlang:universaltime(),
     {_,_,NowPart} = now(),
-    list_to_binary(lists:flatten(io_lib:format(
-           "~4.4.0w~2.2.0w~2.2.0w~2.2.0w~2.2.0w~2.2.0w-~s-~s-~p",
-                    [Y,Mo,D,H,Mi,S,node(),RemoteNode,NowPart]))).
+    Id = erlang:phash2([Y,Mo,D,H,Mi,S,node(),RemoteNode,NowPart]),
+    <<Id:32>>.
 
 %% @spec chash_key(BKey :: riak_object:bkey()) -> chash:index().
 %% @doc Create a binary used for determining replica placement.