2016-08-15 22:14:29 +00:00
|
|
|
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
|
2022-10-06 03:52:38 +00:00
|
|
|
hash.setupInterface = nil
|
2016-08-15 22:14:29 +00:00
|
|
|
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
|