aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-16 20:57:14 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-16 20:57:14 +0100
commite7b48149fc6d9d2cac3b8f9669a2fea126b8f688 (patch)
tree70792fb549f7e10d7f28d068ce5f1b809236c38e
parent4efc7e1df9863dae9314a9914fcdf5fe47d8d258 (diff)
downloadrspamd-e7b48149fc6d9d2cac3b8f9669a2fea126b8f688.tar.gz
rspamd-e7b48149fc6d9d2cac3b8f9669a2fea126b8f688.zip
[Minor] Selectors: Add ability to use base32 variants
-rw-r--r--lualib/lua_selectors/transforms.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua
index b0c912deb..5f1a4dca0 100644
--- a/lualib/lua_selectors/transforms.lua
+++ b/lualib/lua_selectors/transforms.lua
@@ -143,6 +143,10 @@ local transform_function = {
s = h:hex()
elseif encoding == 'base32' then
s = h:base32()
+ elseif encoding == 'bleach32' then
+ s = h:base32('bleach')
+ elseif encoding == 'rbase32' then
+ s = h:base32('rfc')
elseif encoding == 'base64' then
s = h:base64()
end
@@ -150,7 +154,7 @@ local transform_function = {
return s,'string'
end,
['description'] = [[Create a digest from a string.
-The first argument is encoding (`hex`, `base32`, `base64`),
+The first argument is encoding (`hex`, `base32` (and forms `bleach32`, `rbase32`), `base64`),
the second argument is optional hash type (`blake2`, `sha256`, `sha1`, `sha512`, `md5`)]],
['args_schema'] = {ts.one_of{'hex', 'base32', 'base64'}:is_optional(),
ts.one_of{'blake2', 'sha256', 'sha1', 'sha512', 'md5'}:is_optional()}