Changes

m
no edit summary
Line 1: Line 1:  +
-- [[Category:Net modules]]
 +
 
local p = {}
 
local p = {}
   Line 13: Line 15:  
     end
 
     end
 
     return true
 
     return true
 +
end
 +
 +
function table.getKeys(self)
 +
local keys = {}
 +
for k,_ in pairs(self) do
 +
table.insert(keys,k)
 +
end
 +
return keys
 +
end
 +
 +
function table.getVals(self)
 +
local vals = {}
 +
for _,v in pairs(self) do
 +
table.insert(vals,v)
 +
end
 +
return vals
 
end
 
end
   Line 38: Line 56:  
-- Hashes a seed if given, if not just returns a hash based on current time.
 
-- Hashes a seed if given, if not just returns a hash based on current time.
 
function p.timeHash(seed)
 
function p.timeHash(seed)
 +
-- lmfao this function wasn't a hash at all because it would never
 +
-- return the same thing twice.
 +
math.randomseed(p.hashString("Amatsukaze-chan is best"))
 +
 
local randomizer = 0
 
local randomizer = 0
 
 
Line 69: Line 91:  
local time = os.time()
 
local time = os.time()
 
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*5501*rand)-math.floor(randomizer*time) + math.floor(math.random()*5501*randomizer)) % 2^32
 
return rtnHash
 
return rtnHash
 
end
 
end
cssedit, gkautomate
6,928

edits