mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-04 20:58:13 +00:00
1fad4da137
Change-Id: Ida2c9cac348fe31ecf8d8c0a352e899bcbff1ebf
31 lines
550 B
Lua
31 lines
550 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
|
|
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
|