From 64772cf0e77038981f30f6310e048c0506a441d5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 12 Apr 2019 12:35:08 +0100 Subject: [PATCH] [Rules] Fix pay-to-hash addresses validation --- rules/regexp/misc.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/regexp/misc.lua b/rules/regexp/misc.lua index d5dac650e..2076c78fa 100644 --- a/rules/regexp/misc.lua +++ b/rules/regexp/misc.lua @@ -130,10 +130,10 @@ local id = rspamd_config:register_symbol{ local acc = base58_dec[ch] or 0 for i=25,1,-1 do acc = acc + (58 * bytes[i]); - bytes[i] = math.fmod(acc, 256); - acc = math.modf(acc / 256); + bytes[i] = acc % 256 + acc = math.floor(acc / 256); end - end, fun.tail(word)) -- Tail due to first byte is version + end, word) -- Now create a validation tag local sha256 = hash.create_specific('sha256') for i=1,21 do -- 2.39.5