This commit is contained in:
Feng 2015-07-05 22:53:54 +08:00
parent 6b48493012
commit d6ea474810
1 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,7 @@
%%% 1. Timestamp: erlang:system_time if Erlang >= R18, otherwise os:timestamp
%%% 2. NodeId: encode node() to 2 bytes integer
%%% 3. Pid: encode pid to 4 bytes integer
%%% 4. Sequence: 2 bytes sequence no per pid
%%% 4. Sequence: 2 bytes sequence per pid
%%%
%%% @end
%%%-----------------------------------------------------------------------------
@ -44,6 +44,10 @@
-type guid() :: <<_:128>>.
%%------------------------------------------------------------------------------
%% @doc Generate a global unique id.
%% @end
%%------------------------------------------------------------------------------
-spec gen() -> guid().
gen() ->
Guid = case get(guid) of