util/random.lua
changeset 12979 d10957394a3c
parent 12450 e54b8a5e35ad
equal deleted inserted replaced
12978:ba409c67353b 12979:d10957394a3c
     4 --
     4 --
     5 -- This project is MIT/X11 licensed. Please see the
     5 -- This project is MIT/X11 licensed. Please see the
     6 -- COPYING file in the source package for more information.
     6 -- COPYING file in the source package for more information.
     7 --
     7 --
     8 
     8 
     9 local ok, crand = pcall(require, "util.crand");
     9 local ok, crand = pcall(require, "prosody.util.crand");
    10 if ok and pcall(crand.bytes, 1) then return crand; end
    10 if ok and pcall(crand.bytes, 1) then return crand; end
    11 
    11 
    12 local urandom, urandom_err = io.open("/dev/urandom", "r");
    12 local urandom, urandom_err = io.open("/dev/urandom", "r");
    13 
    13 
    14 local function bytes(n)
    14 local function bytes(n)