-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc/userguide: document Lua base64 library
Ticket: #7074
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Base64 | ||
------ | ||
|
||
Base64 functions are expose to Lua scripts with the | ||
``suricata.base64``. 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 encoded but don't include any | ||
padding. | ||
|
||
``decode_nopad(string)`` | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Decode a base64 buffer that contains no padding. | ||
|
||
``decode_padopt(string)`` | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Decode a base64 buffer that may or may not contain trailing padding. | ||
|
||
``decode_rfc2045(string)`` | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Decode RFC 2045 formatted base64. | ||
|
||
``decode_rfc4648(string)`` | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Decode RFC 4648 formatted base64. | ||
|
||
Implementation Details | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The base64 functions provided come from the Rust base64 library | ||
documented at https://docs.rs/base64 and corresponse to the | ||
``STANDARD`` and ``STANDARD_NO_PAD`` base64 engines provided in that | ||
library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ environment without access to additional modules. | |
|
||
.. toctree:: | ||
|
||
base64 | ||
hashlib |