aboutsummaryrefslogtreecommitdiffstats
path: root/util/random.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-18 10:16:59 +0200
committerKim Alvefur <zash@zash.se>2014-09-18 10:16:59 +0200
commitff30d91a0d32a4747b50f5bbd1ec5b2076073ec7 (patch)
treee93ec669ae05f7a83dac28dadabeaf552e803602 /util/random.lua
parente9fa1d1db3a14e8b0d989c3c3e983521034ad38c (diff)
downloadprosody-ff30d91a0d32a4747b50f5bbd1ec5b2076073ec7.tar.gz
prosody-ff30d91a0d32a4747b50f5bbd1ec5b2076073ec7.zip
util.random: Switch to SHA512
Diffstat (limited to 'util/random.lua')
-rw-r--r--util/random.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/random.lua b/util/random.lua
index ed5cdf4b..328bdb00 100644
--- a/util/random.lua
+++ b/util/random.lua
@@ -10,7 +10,7 @@ local tostring = tostring;
local os_time = os.time;
local os_clock = os.clock;
local ceil = math.ceil;
-local sha1 = require "util.hashes".sha1;
+local H = require "util.hashes".sha512;
local last_uniq_time = 0;
local function uniq_time()
@@ -21,7 +21,7 @@ local function uniq_time()
end
local function new_random(x)
- return sha1(x..os_clock()..tostring({}));
+ return H(x..os_clock()..tostring({}));
end
local buffer = new_random(uniq_time());