2023年政策修订增补工作正在进行中,欢迎参与!
Module:HashArgs
跳转到导航
跳转到搜索
-- Originally designed and coded by Maya (U:Maya-Maja-Maia)
local getArgs = require('Module:Arguments').getArgs
local hashObj = function (obj)
local algo = obj.algo
local actualAlgo = "sha256" -- safer than md5, but really who cares
if algo then
local algoList = mw.hash.listAlgorithms()
for i, v in ipairs(algoList) do
if algo == v then
actualAlgo = algo
break
end
end
end
return mw.hash.hashValue(actualAlgo, mw.dumpObject(obj))
end
local hashArgs = {
main = function (frame)
return hashObj(getArgs(frame))
end,
hashObj = hashObj
}
return hashArgs