diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 2026a437..744baa85 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -1330,9 +1330,12 @@ static int rom_getfilename(lua_State *L) { static int rom_gethash(lua_State *L) { const char *type = luaL_checkstring(L, 1); - if(!type) lua_pushstring(L, ""); - else if(!stricmp(type,"md5")) lua_pushstring(L, md5_asciistr(GameInfo->MD5)); - else lua_pushstring(L, ""); + MD5DATA md5hash = GameInfo->MD5; + + if (!type) lua_pushstring(L, ""); + else if (!stricmp(type, "md5")) lua_pushstring(L, md5_asciistr(md5hash)); + else if (!stricmp(type, "base64")) lua_pushstring(L, BytesToString(md5hash.data, MD5DATA::size).c_str()); + else lua_pushstring(L, ""); return 1; } diff --git a/web/help/LuaFunctionsList.html b/web/help/LuaFunctionsList.html index 5854e01a..3b8ebd55 100644 --- a/web/help/LuaFunctionsList.html +++ b/web/help/LuaFunctionsList.html @@ -224,7 +224,7 @@


rom.gethash(string type)


-

Get a hash of the ROM loaded, for verification. The only currently supported type is "md5".

+

Get a hash of the ROM loaded, for verification. If type is "md5", returns a hex string of the MD5 hash. If type is "base64", returns a base64 string of the MD5 hash, just like the movie romChecksum value.


rom.readbyte(int address)

rom.readbyteunsigned(int address)