• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
Line 35: Line 35:  
end
 
end
    +
 +
-- Hashes a seed if given, if not just returns a hash based on current time.
 
function p.timeHash(seed)
 
function p.timeHash(seed)
 
local randomizer = 0
 
local randomizer = 0
Line 68: Line 70:  
local rand = math.random()
 
local rand = math.random()
 
local rtnHash = (math.floor(time*265314426625821*rand)-randomizer*time) % 2^32+math.floor(math.random()*1381242451)*randomizer
 
local rtnHash = (math.floor(time*265314426625821*rand)-randomizer*time) % 2^32+math.floor(math.random()*1381242451)*randomizer
-- local step1 = math.floor(time*265314426625821*rand)
+
return rtnHash
-- local step2 = randomizer*time
  −
-- local step3 = step1-step2
  −
-- local step4 = step3 % 2^32
  −
-- local step5 = math.floor(math.random()*1381242451)
  −
-- local step6 = step5*randomizer
  −
-- local step7 = step4 + step6
  −
-- local rtnStr = tostring(step1) .. " | " .. tostring(step2) .. " | " .. tostring(step3) .. " | " .. tostring(step4) .. " | " .. tostring(step5) .. " | " .. tostring(step6).. " | " .. tostring(step7) .. " | " .. tostring(rtnHash)
  −
local rtnStr = tostring(rtnHash)
  −
return rtnStr
  −
-- return (math.floor(time*265314426625821*rand)-randomizer) % 2^32+math.floor(math.random()*1381242451)
   
end
 
end
  
2,922

edits

Navigation menu