Skip to content

Instantly share code, notes, and snippets.

@thequux
Created November 3, 2013 23:14
Show Gist options
  • Save thequux/7295951 to your computer and use it in GitHub Desktop.
Save thequux/7295951 to your computer and use it in GitHub Desktop.
char BASE64_ILUT[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
char BASE64_LUT[256];
void init_base64_lut(void) {
int i;
for (i = 0; i < 256; i++) {
BASE64_LUT[i] = 255;
}
for (i = 0; i < 64; i++) {
BASE64_LUT[BASE64_ILUT[i]] = i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment