1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

support base64 encode

This commit is contained in:
莫战 2020-12-01 11:26:54 +08:00 committed by winlin
parent 58b75c6f1b
commit dc7124cd05
3 changed files with 153 additions and 6 deletions

View file

@ -141,6 +141,8 @@ extern uint32_t srs_crc32_ieee(const void* buf, int size, uint32_t previous = 0)
// Decode a base64-encoded string.
extern srs_error_t srs_av_base64_decode(std::string cipher, std::string& plaintext);
// Encode a plaintext to base64-encoded string.
extern srs_error_t srs_av_base64_encode(std::string plaintext, std::string& cipher);
// Calculate the output size needed to base64-encode x bytes to a null-terminated string.
#define SRS_AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)