1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-14 03:39:49 +00:00

remove random seed

This commit is contained in:
skywind3000
2018-04-02 22:56:10 +08:00
parent 3f83ca7d89
commit 41e0f7ac6b

11
z.lua
View File

@@ -436,17 +436,6 @@ function math.random_init()
end
local ppid = os.getenv('PPID')
seed = (ppid ~= nil) and (seed .. '/' .. ppid) or seed
if not windows then
local fp = io.open('/dev/random', 'rb')
if fp == nil then
fp = io.open('/dev/urandom', 'rb')
end
if fp ~= nil then
local data = fp:read(32)
seed = seed .. '/' .. data
fp:close()
end
end
local number = 0
for i = 1, seed:len() do
local k = string.byte(seed:sub(i, i))