diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-10 16:01:57 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-10 16:01:57 +0530 |
| commit | a14da2fe3864712dab4e7c4cfb5c323026d668de (patch) | |
| tree | 418c8c8ff44a611cbe1c1269b10926527046e232 /src/server/base64.c | |
| parent | 2761f8a533e2b025f209222a1e4ec70b91c7e8ee (diff) | |
moving header files to include directory & moving resources in it's own directory
i know currently there is race condition, but the code is getting too
messy, i will continue to this after i make a vis tool to analyse how i
should split up files & stuff
the code rn needs intense restructing for it to make any more progress
Diffstat (limited to 'src/server/base64.c')
| -rw-r--r-- | src/server/base64.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/server/base64.c b/src/server/base64.c deleted file mode 100644 index e3e0ef6..0000000 --- a/src/server/base64.c +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef BASE64_C -#define BASE64_C - -#include <stddef.h> - -static const char b64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - -void base64_encode( - const unsigned char *in, - size_t len, - char *out -) { - size_t i, j = 0; - - for (i = 0; i < len; i += 3) { - unsigned v = in[i] << 16; - - if (i + 1 < len) v |= in[i + 1] << 8; - if (i + 2 < len) v |= in[i + 2]; - - out[j++] = b64[(v >> 18) & 63]; - out[j++] = b64[(v >> 12) & 63]; - - out[j++] = (i + 1 < len) ? b64[(v >> 6) & 63] : '='; - out[j++] = (i + 2 < len) ? b64[v & 63] : '='; - } - - out[j] = 0; -} - -#endif // BASE64_C |
