/
yegorzh
/
pgbackrest
Обзор
Документация
Войти
/
yegorzh
/
pgbackrest
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/common/encode.h
34 строки
2 KB
David Steele
Split VR_EXTERN/FN_EXTERN macros from FV_EXTERN.
02 янв 2023, 11:24
02 янв 2023, 11:24
f018912
Код
Авторство
О чём код?
/*********************************************************************************************************************************** Binary to String Encode/Decode ***********************************************************************************************************************************/ #ifndef COMMON_ENCODE_H #define COMMON_ENCODE_H #include <stddef.h> /*********************************************************************************************************************************** Encoding types ***********************************************************************************************************************************/ typedef enum { encodingBase64, encodingBase64Url, encodingHex, } EncodingType; /*********************************************************************************************************************************** Functions ***********************************************************************************************************************************/ // Encode binary data to a printable string FN_EXTERN void encodeToStr(EncodingType type, const unsigned char *source, size_t sourceSize, char *destination); // Size of the string returned by encodeToStr() FN_EXTERN size_t encodeToStrSize(EncodingType type, size_t sourceSize); // Decode a string to binary data FN_EXTERN void decodeToBin(EncodingType type, const char *source, unsigned char *destination); // Size of the binary data returned by decodeToBin() FN_EXTERN size_t decodeToBinSize(EncodingType type, const char *source); #endif