#ifndef AWS_COMMON_ENCODING_H
#define AWS_COMMON_ENCODING_H
#include <aws/common/byte_buf.h>
#include <aws/common/byte_order.h>
#include <aws/common/common.h>
#include <memory.h>
AWS_EXTERN_C_BEGIN
AWS_COMMON_API
int aws_hex_compute_encoded_len(size_t to_encode_len, size_t *encoded_length);
AWS_COMMON_API
int aws_hex_encode(const struct aws_byte_cursor *AWS_RESTRICT to_encode, struct aws_byte_buf *AWS_RESTRICT output);
AWS_COMMON_API
int aws_hex_encode_append_dynamic(
const struct aws_byte_cursor *AWS_RESTRICT to_encode,
struct aws_byte_buf *AWS_RESTRICT output);
AWS_COMMON_API
int aws_hex_compute_decoded_len(size_t to_decode_len, size_t *decoded_len);
AWS_COMMON_API
int aws_hex_decode(const struct aws_byte_cursor *AWS_RESTRICT to_decode, struct aws_byte_buf *AWS_RESTRICT output);
AWS_COMMON_API
int aws_base64_compute_encoded_len(size_t to_encode_len, size_t *encoded_len);
AWS_COMMON_API
int aws_base64_encode(const struct aws_byte_cursor *AWS_RESTRICT to_encode, struct aws_byte_buf *AWS_RESTRICT output);
AWS_COMMON_API
int aws_base64_compute_decoded_len(const struct aws_byte_cursor *AWS_RESTRICT to_decode, size_t *decoded_len);
AWS_COMMON_API
int aws_base64_decode(const struct aws_byte_cursor *AWS_RESTRICT to_decode, struct aws_byte_buf *AWS_RESTRICT output);
AWS_STATIC_IMPL void aws_write_u64(uint64_t value, uint8_t *buffer);
AWS_STATIC_IMPL uint64_t aws_read_u64(const uint8_t *buffer);
AWS_STATIC_IMPL void aws_write_u32(uint32_t value, uint8_t *buffer);
AWS_STATIC_IMPL uint32_t aws_read_u32(const uint8_t *buffer);
AWS_STATIC_IMPL void aws_write_u24(uint32_t value, uint8_t *buffer);
AWS_STATIC_IMPL uint32_t aws_read_u24(const uint8_t *buffer);
AWS_STATIC_IMPL void aws_write_u16(uint16_t value, uint8_t *buffer);
AWS_STATIC_IMPL uint16_t aws_read_u16(const uint8_t *buffer);
enum aws_text_encoding {
AWS_TEXT_UNKNOWN,
AWS_TEXT_UTF8,
AWS_TEXT_UTF16,
AWS_TEXT_UTF32,
AWS_TEXT_ASCII,
};
AWS_STATIC_IMPL enum aws_text_encoding aws_text_detect_encoding(const uint8_t *bytes, size_t size);
AWS_STATIC_IMPL bool aws_text_is_utf8(const uint8_t *bytes, size_t size);
#ifndef AWS_NO_STATIC_IMPL
# include <aws/common/encoding.inl>
#endif
AWS_EXTERN_C_END
#endif