Azure SDK for Embedded C
az_base64.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 
16 #ifndef _az_BASE64_H
17 #define _az_BASE64_H
18 
19 #include <azure/core/az_result.h>
20 #include <azure/core/az_span.h>
21 
22 #include <stdint.h>
23 
24 #include <azure/core/_az_cfg_prefix.h>
25 
41 AZ_NODISCARD az_result
42 az_base64_encode(az_span destination_base64_text, az_span source_bytes, int32_t* out_written);
43 
52 AZ_NODISCARD int32_t az_base64_get_max_encoded_size(int32_t source_bytes_size);
53 
74 AZ_NODISCARD az_result
75 az_base64_decode(az_span destination_bytes, az_span source_base64_text, int32_t* out_written);
76 
85 AZ_NODISCARD int32_t az_base64_get_max_decoded_size(int32_t source_base64_text_size);
86 
108  az_span destination_bytes,
109  az_span source_base64_url_text,
110  int32_t* out_written);
111 
120 AZ_NODISCARD int32_t az_base64_url_get_max_decoded_size(int32_t source_base64_url_text_size);
121 
122 #include <azure/core/_az_cfg_suffix.h>
123 
124 #endif // _az_BASE64_H
az_result.h
Definition of az_result and helper functions.
az_result
int32_t az_result
The type represents the various success and error conditions.
Definition: az_result.h:46
az_base64_get_max_encoded_size
AZ_NODISCARD int32_t az_base64_get_max_encoded_size(int32_t source_bytes_size)
Returns the maximum length of the result if you were to encode an az_span of the specified length whi...
az_base64_url_get_max_decoded_size
AZ_NODISCARD int32_t az_base64_url_get_max_decoded_size(int32_t source_base64_url_text_size)
Returns the maximum length of the result if you were to decode an az_span of the specified length whi...
az_base64_url_decode
AZ_NODISCARD az_result az_base64_url_decode(az_span destination_bytes, az_span source_base64_url_text, int32_t *out_written)
Decodes the span of UTF-8 encoded text represented as base 64 url into binary data.
az_span.h
An az_span represents a contiguous byte buffer and is used for string manipulations,...
az_base64_encode
AZ_NODISCARD az_result az_base64_encode(az_span destination_base64_text, az_span source_bytes, int32_t *out_written)
Encodes the span of binary data into UTF-8 encoded text represented as base 64.
az_base64_decode
AZ_NODISCARD az_result az_base64_decode(az_span destination_bytes, az_span source_base64_text, int32_t *out_written)
Decodes the span of UTF-8 encoded text represented as base 64 into binary data.
az_span
Represents a "view" over a byte buffer that represents a contiguous region of memory....
Definition: az_span.h:33
az_base64_get_max_decoded_size
AZ_NODISCARD int32_t az_base64_get_max_decoded_size(int32_t source_base64_text_size)
Returns the maximum length of the result if you were to decode an az_span of the specified length whi...