summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_util.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_util.erl')
-rw-r--r--src/couchdb/couch_util.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/couchdb/couch_util.erl b/src/couchdb/couch_util.erl
index 504a675a..94648b0d 100644
--- a/src/couchdb/couch_util.erl
+++ b/src/couchdb/couch_util.erl
@@ -40,7 +40,7 @@ start_link(LibDir) ->
new_uuid() ->
- to_hex(erlang:port_control(drv_port(), 2, <<>>)).
+ to_hex(binary_to_list(crypto:rand_bytes(16))).
to_hex([]) ->
[];
@@ -57,8 +57,7 @@ to_digit(N) ->
% returns a random integer
rand32() ->
- [A,B,C,D|_] = erlang:port_control(drv_port(), 2, <<>>),
- (A bsl 24) + (B bsl 16) + (C bsl 8) + D.
+ crypto:rand_uniform(0, 16#100000000).
% given a pathname "../foo/bar/" it gives back the fully qualified
% absolute pathname.