Module safe_network::client::utils [−][src]
Expand description
Utility functions.
Modules
Common utility functions for writing test cases.
Constants
Length of the symmetric encryption key.
Length of the nonce used for symmetric encryption.
Functions
Convert binary data to a diplay-able format
Generates a nonce for symmetric encryption
Generates a String
from length
random UTF-8 char
s. Note that the NULL character will be
excluded to allow conversion to a CString
if required, and that the actual len()
of the
returned String
will likely be around 4 * length
as most of the randomly-generated char
s
will consume 4 elements of the String
.
Generates a random vector using provided length
.
Generates a readable String
using provided length
and only ASCII characters.
Generates a symmetric encryption key
Symmetric decryption.
Symmetric encryption.
If nonce
is None
, then it will be generated randomly.