]> source.dussan.org Git - rspamd.git/commitdiff
[Rules] Fix pay-to-hash addresses validation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 12 Apr 2019 11:35:08 +0000 (12:35 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 12 Apr 2019 11:35:08 +0000 (12:35 +0100)
rules/regexp/misc.lua

index d5dac650eda87b833bb0fd8fdd8e0c198a704db4..2076c78faa559601e91efd45b433e3ae3b891f48 100644 (file)
@@ -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