MCPcopy Create free account
hub / github.com/axmolengine/axmol / base64Encode

Function base64Encode

core/base/Utils.cpp:919–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

917}
918
919int base64Encode(const unsigned char* in, unsigned int inLength, char** out)
920{
921 auto n = ax::base64::encoded_size(inLength);
922 // should be enough to store 8-bit buffers in 6-bit buffers
923 char* tmp = nullptr;
924 if (n > 0 && (tmp = (char*)malloc(n + 1)))
925 {
926 auto ret = ax::base64::encode(tmp, in, inLength);
927 tmp[ret] = '\0';
928 *out = tmp;
929 return static_cast<int>(ret);
930 }
931 *out = nullptr;
932 return 0;
933}
934
935AX_DLL int base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** out)
936{

Callers 2

computeDigestFunction · 0.70
computeFileDigestFunction · 0.70

Calls 1

encoded_sizeFunction · 0.85

Tested by

no test coverage detected