18.3.1. Base64
Base64 functions are exposed to Lua scripts with the
suricata.base64
library. For example:
local base64 = require("suricata.base64")
18.3.1.1. Functions
18.3.1.1.1. encode(string)
Encode a buffer with standard base64 encoding. This standard encoding includes padding.
18.3.1.1.2. decode(string)
Decode a base64 string that contains padding.
18.3.1.1.3. encode_nopad(string)
Encode a buffer with standard base64 encoding but don't include any padding.
18.3.1.1.4. decode_nopad(string)
Decode a base64 string that contains no padding.
18.3.1.1.5. decode_padopt(string)
Decode a base64 string that may or may not contain trailing padding.
18.3.1.1.6. decode_rfc2045(string)
Decode an RFC 2045 formatted base64 string.
18.3.1.1.7. decode_rfc4648(string)
Decode an RFC 4648 formatted base64 string.
18.3.1.2. Implementation Details
The base64 functions provided come from the Rust base64 library
documented at https://docs.rs/base64 and correspond to the
STANDARD
and STANDARD_NO_PAD
base64 engines provided in that
library.