mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Scribunto: Add HashLibrary [#589]
This commit is contained in:
BIN
res/bin/any/java/bouncycastle/bcprov-jdk15on-164.jar
Normal file
BIN
res/bin/any/java/bouncycastle/bcprov-jdk15on-164.jar
Normal file
Binary file not shown.
BIN
res/bin/any/java/getopt/utils-1.0.jar
Normal file
BIN
res/bin/any/java/getopt/utils-1.0.jar
Normal file
Binary file not shown.
BIN
res/bin/any/java/gnu/gnu-crypto.jar
Normal file
BIN
res/bin/any/java/gnu/gnu-crypto.jar
Normal file
Binary file not shown.
BIN
res/bin/any/java/jacksum/jacksum.jar
Normal file
BIN
res/bin/any/java/jacksum/jacksum.jar
Normal file
Binary file not shown.
@@ -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
|
||||
Reference in New Issue
Block a user