Skip to content

Commit

Permalink
Use uuid_v4 for pubsub's made-up uniqid items
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed Feb 19, 2021
1 parent 047b483 commit 157e2d1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/pubsub/mod_pubsub.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4470,8 +4470,7 @@ string_to_ljid(JID) ->

-spec uniqid() -> mod_pubsub:itemId().
uniqid() ->
{T1, T2, T3} = os:timestamp(),
iolist_to_binary(io_lib:fwrite("~.16B~.16B~.16B", [T1, T2, T3])).
uuid:uuid_to_string(uuid:get_v4(), binary_standard).

node_attr(Node) -> [{<<"node">>, Node}].

Expand Down

0 comments on commit 157e2d1

Please sign in to comment.