MCPcopy Create free account
hub / github.com/audacity/audacity / decode_chunk

Function decode_chunk

lib-src/lv2/serd/src/string.c:178–185  ·  view source on GitHub ↗

Decode 4 base64 characters to 3 raw bytes. */

Source from the content-addressed store, hash-verified

176 Decode 4 base64 characters to 3 raw bytes.
177*/
178static inline size_t
179decode_chunk(const uint8_t in[4], uint8_t out[3])
180{
181 out[0] = (uint8_t)(((unmap(in[0]) << 2)) | unmap(in[1]) >> 4);
182 out[1] = (uint8_t)(((unmap(in[1]) << 4) & 0xF0) | unmap(in[2]) >> 2);
183 out[2] = (uint8_t)(((unmap(in[2]) << 6) & 0xC0) | unmap(in[3]));
184 return 1 + (in[2] != '=') + ((in[2] != '=') && (in[3] != '='));
185}
186
187void*
188serd_base64_decode(const uint8_t* str, size_t len, size_t* size)

Callers 1

serd_base64_decodeFunction · 0.85

Calls 1

unmapFunction · 0.70

Tested by

no test coverage detected