From: Vsevolod Stakhov Date: Fri, 12 Apr 2019 11:35:08 +0000 (+0100) Subject: [Rules] Fix pay-to-hash addresses validation X-Git-Tag: 1.9.2~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=64772cf0e77038981f30f6310e048c0506a441d5;p=rspamd.git [Rules] Fix pay-to-hash addresses validation --- 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