Lua: start of crypto.* API

This commit is contained in:
Zef Hemel
2025-11-07 10:49:13 +01:00
parent 13bd2c9082
commit f65abb4704
3 changed files with 30 additions and 3 deletions
+10
View File
@@ -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)