From 4ca89cfcaee19fc2b816efc966d01827b26dc54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 12 Feb 2022 20:08:03 +0100 Subject: [PATCH] Update groupcaps_hash function to minetest.sha1 --- mods/ITEMS/mcl_enchanting/groupcaps.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_enchanting/groupcaps.lua b/mods/ITEMS/mcl_enchanting/groupcaps.lua index a445b73f21..ec8d11d21e 100644 --- a/mods/ITEMS/mcl_enchanting/groupcaps.lua +++ b/mods/ITEMS/mcl_enchanting/groupcaps.lua @@ -2,10 +2,7 @@ local groupcaps_cache = {} -- Compute a hash value. function compute_hash(value) - -- minetest.get_password_hash is quite fast, even if it uses a - -- cryptographic hashing function (SHA-1). It is written in C++ and it - -- is probably hard to write a faster hashing function in Lua. - return string.sub(minetest.get_password_hash("ryvnf", minetest.serialize(value)), 1, 8) + return string.sub(minetest.sha1(minetest.serialize(value)), 1, 8) end -- Get the groupcaps and hash for an enchanted tool. If this function is called