]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc/userguide: document Lua base64 library 12579/head
authorJason Ish <jason.ish@oisf.net>
Mon, 27 Jan 2025 22:56:29 +0000 (16:56 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 13 Feb 2025 18:21:05 +0000 (19:21 +0100)
Ticket: #7074

doc/userguide/lua/libs/base64.rst [new file with mode: 0644]
doc/userguide/lua/libs/index.rst

diff --git a/doc/userguide/lua/libs/base64.rst b/doc/userguide/lua/libs/base64.rst
new file mode 100644 (file)
index 0000000..4b8b5f8
--- /dev/null
@@ -0,0 +1,55 @@
+Base64
+------
+
+Base64 functions are exposed to Lua scripts with the
+``suricata.base64`` library. For example::
+
+  local base64 = require("suricata.base64")
+
+Functions
+~~~~~~~~~
+
+``encode(string)``
+^^^^^^^^^^^^^^^^^^
+
+Encode a buffer with standard base64 encoding. This standard encoding
+includes padding.
+
+``decode(string)``
+^^^^^^^^^^^^^^^^^^
+
+Decode a base64 string that contains padding.
+
+``encode_nopad(string)``
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Encode a buffer with standard base64 encoding but don't include any
+padding.
+
+``decode_nopad(string)``
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Decode a base64 string that contains no padding.
+
+``decode_padopt(string)``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Decode a base64 string that may or may not contain trailing padding.
+
+``decode_rfc2045(string)``
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Decode an RFC 2045 formatted base64 string.
+
+``decode_rfc4648(string)``
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Decode an RFC 4648 formatted base64 string.
+
+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.
index 9734a623f91df8c44b635decc23426d02a33b1f7..d9b4c393ccbc9245a1582badee6bbe89e39609d5 100644 (file)
@@ -8,5 +8,6 @@ environment without access to additional modules.
 
 .. toctree::
 
+   base64
    hashlib
    packetlib