mediawiki-extensions-Scribunto/includes/Engines/LuaCommon/lualib/mw.hash.lua
Kunal Mehta 9d94f11309 Hide mw.hash.setupInterface from users
Part of the standard library boilerplate that got missed.

Bug: T276138
Change-Id: I6d55d55405b57b18f3f413a108848f34620c15a6
2022-10-08 22:01:00 +00:00

32 lines
577 B
Lua

local hash = {}
local php
local util = require 'libraryUtil'
local checkType = util.checkType
function hash.listAlgorithms()
return php.listAlgorithms()
end
function hash.hashValue( algo, value )
checkType( 'hashValue', 1, algo, 'string' )
checkType( 'hashValue', 2, value, 'string' )
return php.hashValue( algo, value )
end
function hash.setupInterface()
-- Boilerplate
hash.setupInterface = nil
php = mw_interface
mw_interface = nil
-- Register this library in the "mw" global
mw = mw or {}
mw.hash = hash
package.loaded['mw.hash'] = hash
end
return hash