projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e7cf77
)
util.random: Switch to SHA512
author
Kim Alvefur
<zash@zash.se>
Thu, 18 Sep 2014 08:16:59 +0000
(10:16 +0200)
committer
Kim Alvefur
<zash@zash.se>
Thu, 18 Sep 2014 08:16:59 +0000
(10:16 +0200)
util/random.lua
patch
|
blob
|
history
diff --git
a/util/random.lua
b/util/random.lua
index ed5cdf4b8b2556ae20505eb06df1425e35d3f745..328bdb00eba147eaa2a350b101d8ed07445c9e73 100644
(file)
--- 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());