tamaki.mes.utils.base64_encode
Description
Base64-encodes the provided byte string. The input should be a byte string (for example
b'string to encode').
Syntax
tamaki.mes.utils.base64_encode(string)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
string | String | False | A byte string to encode (for example b'...'). |
Returns
A base64-encoded byte string.
Code Examples
# Encode a value to embed safely in a page URL query parameter
encodedLocation = tamaki.mes.utils.base64_encode(str(locationId))
params.append('locationId=' + str(encodedLocation))