Lua: start of crypto.* API
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
local function assertEqual(a, b)
|
||||
if a ~= b then
|
||||
error("Assertion failed: " .. a .. " is not equal to " .. b)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local s = crypto.sha256(encoding.utf8Encode("test"))
|
||||
local s2 = crypto.sha256("test")
|
||||
assertEqual(s, s2)
|
||||
Reference in New Issue
Block a user