diff --git a/src/ffi/lua.rs b/src/ffi/lua.rs index 8bd59e8..b6ac318 100644 --- a/src/ffi/lua.rs +++ b/src/ffi/lua.rs @@ -269,6 +269,10 @@ fn get_logger(_: &Lua, (): ()) -> LuaResult { Ok(LuaLogger(sub)) } +fn hash(_: &Lua, (txt,): (String,)) -> LuaResult { + Ok(crate::hash(txt)) +} + // define module and exports #[mlua::lua_module] fn codemp_lua(lua: &Lua) -> LuaResult { @@ -279,6 +283,9 @@ fn codemp_lua(lua: &Lua) -> LuaResult { exports.set("get_client", lua.create_function(get_client)?)?; exports.set("close_client", lua.create_function(close_client)?)?; + // utils + exports.set("hash", lua.create_function(hash)?)?; + // runtime exports.set("runtime_drive_forever", lua.create_function(runtime_drive_forever)?)?;