11. Lua哈希碰撞示例
local t = {}
local n = 10000
for i = 1, n do
local s = ('0'):rep(28) .. string.char(i/255) .. '0' ..
string.char(i%255) .. '0'
-- global string table colliding
t[#t+1] = s
-- global string table and table hash colliding
--t[s] = 1
end
14. LuaJIT哈希碰撞示例
local t = {}
local n = 10000
for i = 1, n do
local s = ('0'):rep(18) .. string.char(i/255) .. string.char
(i%255) .. ('0'):rep(12)
-- global string table colliding
t[#t+1] = s
-- global string table and table hash colliding
--t[s] = 1
end