blob: 1f3d5944cf9a574c38138196fac4e622658917bf [file] [log] [blame]
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
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++)
x |= (uint32_t)(strchr(digits, *s) - digits) << e;
return x;
}