#include #include #include static const char digits[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; long a64l(const char *s) { int e; uint32_t x = 0; for (e=0; e<36 && *s; e+=6, s++) { const char *d = strchr(digits, *s); if (!d) break; x |= (uint32_t)(d-digits)<>=6) *p = digits[x&63]; *p = 0; return s; }