return res and d or nil
end
-local function slice_table(tbl, first, last, step)
- local sliced = {}
-
- for i = first or 1, last or #tbl, step or 1 do
- sliced[#sliced+1] = tbl[i]
- end
-
- return sliced
-end
-
local function is_segwit_bech32_address(task, word)
local semicolon_pos = string.find(word, ':')
local address_part = word
lua_util.debugm(N, task, 'check %s, %s decoded', word, decoded)
if decoded and #decoded > 8 then
- local c = 1
- local prefix = word:sub(1, semicolon_pos - 1)
+ prefix = word:sub(1, semicolon_pos - 1)
local polymod_tbl = {}
fun.each(function(byte)
local b = bit.band(string.byte(byte), 0x1f)
-- For semicolon
table.insert(polymod_tbl, 0)
- fun.each(function(byte) c = table.insert(polymod_tbl, byte) end, decoded)
+ fun.each(function(byte) table.insert(polymod_tbl, byte) end, decoded)
lua_util.debugm(N, task, 'final polymod table: %s', polymod_tbl)
return rspamd_util.btc_polymod(polymod_tbl)