非正式攻略组招募
如果你热爱女神转生 or 异闻录系列 并且愿意为女神异闻录WIKI添砖添瓦
可以加群一起共同建设,招募详情页见攻略组招募公告
——Pser_hanser
全站通知:
模块:Hash
刷
历
编
跳到导航
跳到搜索
此模块的文档可以在模块:Hash/doc创建
local p = {}
local getArgs = require('Module:Arguments').getArgs
p.main = function(frame)
local args = getArgs(frame)
local str = args[1]
local algo = args[2]
local algoList = mw.hash.listAlgorithms()
if algo then
local isInvalid = true
for i, v in ipairs(algoList) do
if algo == v then
isInvalid = false
break
end
end
if isInvalid then
error('所选的hash算法不可用或无效,所有可用的算法:'..table.concat(algoList, '、'))
else
return mw.hash.hashValue(algo, str)
end
else
return mw.hash.hashValue('md5', str)
end
end
return p