Base64¶
| Spice | |
|---|---|
Functions¶
encodeBase64¶
| Spice | |
|---|---|
Encode the given raw string to base64, using the standard alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
string |
String to encode, excluding its null terminator |
padding |
bool |
Pad the output with '=' to a multiple of 4 chars or not (default: true) |
Returns: String — Base64 representation of the input
encodeBase64¶
| Spice | |
|---|---|
Encode the given string to base64, using the standard alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
const String& |
String to encode. All of its bytes are encoded, including null bytes |
padding |
bool |
Pad the output with '=' to a multiple of 4 chars or not (default: true) |
Returns: String — Base64 representation of the input
encodeBase64¶
| Spice | |
|---|---|
Encode the given raw bytes to base64, using the standard alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
const byte[] |
Bytes to encode |
length |
unsigned long |
Number of bytes to encode |
padding |
bool |
Pad the output with '=' to a multiple of 4 chars or not (default: true) |
Returns: String — Base64 representation of the input
encodeBase64Url¶
| Spice | |
|---|---|
Encode the given raw string to base64, using the URL- and filename-safe alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
string |
String to encode, excluding its null terminator |
padding |
bool |
Pad the output with '=' to a multiple of 4 chars or not (default: true) |
Returns: String — Base64 representation of the input
encodeBase64Url¶
| Spice | |
|---|---|
Encode the given string to base64, using the URL- and filename-safe alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
const String& |
String to encode. All of its bytes are encoded, including null bytes |
padding |
bool |
Pad the output with '=' to a multiple of 4 chars or not (default: true) |
Returns: String — Base64 representation of the input
encodeBase64Url¶
| Spice | |
|---|---|
Encode the given raw bytes to base64, using the URL- and filename-safe alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
const byte[] |
Bytes to encode |
length |
unsigned long |
Number of bytes to encode |
padding |
bool |
Pad the output with '=' to a multiple of 4 chars or not (default: true) |
Returns: String — Base64 representation of the input
decodeBase64¶
| Spice | |
|---|---|
Decode the given base64 string, that uses the standard alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
string |
Base64 string, with or without padding |
Returns: Result<String> — Decoded bytes, or an error if the input is no valid base64
decodeBase64¶
| Spice | |
|---|---|
Decode the given base64 string, that uses the standard alphabet. The padding is optional, but if present, it has to be complete. Chars outside of the alphabet, including whitespace and line breaks, are rejected.
Parameters
| Name | Type | Description |
|---|---|---|
input |
const String& |
Base64 string, with or without padding |
Returns: Result<String> — Decoded bytes, or an error if the input is no valid base64
decodeBase64Url¶
| Spice | |
|---|---|
Decode the given base64 string, that uses the URL- and filename-safe alphabet
Parameters
| Name | Type | Description |
|---|---|---|
input |
string |
Base64 string, with or without padding |
Returns: Result<String> — Decoded bytes, or an error if the input is no valid base64
decodeBase64Url¶
| Spice | |
|---|---|
Decode the given base64 string, that uses the URL- and filename-safe alphabet. The padding is optional, but if present, it has to be complete. Chars outside of the alphabet, including whitespace and line breaks, are rejected.
Parameters
| Name | Type | Description |
|---|---|---|
input |
const String& |
Base64 string, with or without padding |
Returns: Result<String> — Decoded bytes, or an error if the input is no valid base64