diff options
author | Yaco <franco@reevo.org> | 2021-10-19 20:30:39 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2021-10-19 20:30:39 -0300 |
commit | 8c201ace3699b4928daf41eb7b4cdcb4565c6f3b (patch) | |
tree | fbd98f026864e9c1919d3ee740b6799ca0c651e2 /www/wiki/extensions/Scribunto/includes/engines/LuaCommon/lualib/mw.hash.lua | |
parent | e3880a1c86acaa3bbd05786ad2f5c586e6511a58 (diff) |
adds Scribunto
Diffstat (limited to 'www/wiki/extensions/Scribunto/includes/engines/LuaCommon/lualib/mw.hash.lua')
-rw-r--r-- | www/wiki/extensions/Scribunto/includes/engines/LuaCommon/lualib/mw.hash.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/www/wiki/extensions/Scribunto/includes/engines/LuaCommon/lualib/mw.hash.lua b/www/wiki/extensions/Scribunto/includes/engines/LuaCommon/lualib/mw.hash.lua new file mode 100644 index 00000000..95026e33 --- /dev/null +++ b/www/wiki/extensions/Scribunto/includes/engines/LuaCommon/lualib/mw.hash.lua @@ -0,0 +1,30 @@ +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 |