| 1 |
local hash = {} |
| 2 |
local php |
| 3 |
|
| 4 |
local util = require 'libraryUtil' |
| 5 |
local checkType = util.checkType |
| 6 |
|
| 7 |
function hash.listAlgorithms() |
| 8 |
return php.listAlgorithms() |
| 9 |
end |
| 10 |
|
| 11 |
function hash.hashValue( algo, value ) |
| 12 |
checkType( 'hashValue', 1, algo, 'string' ) |
| 13 |
checkType( 'hashValue', 2, value, 'string' ) |
| 14 |
|
| 15 |
return php.hashValue( algo, value ) |
| 16 |
end |
| 17 |
|
| 18 |
function hash.setupInterface() |
| 19 |
|
| 20 |
hash.setupInterface = nil |
| 21 |
php = mw_interface |
| 22 |
mw_interface = nil |
| 23 |
|
| 24 |
|
| 25 |
mw = mw or {} |
| 26 |
mw.hash = hash |
| 27 |
|
| 28 |
package.loaded['mw.hash'] = hash |
| 29 |
end |
| 30 |
|
| 31 |
return hash |