base32 decode uppercase #75

This commit is contained in:
J. A. Bezemer 2009-09-20 15:11:03 +00:00 committed by Erik Ekman
parent b6eb8d75d4
commit fb17474438

View file

@ -26,6 +26,8 @@
static const char cb32[] = static const char cb32[] =
"abcdefghijklmnopqrstuvwxyz012345"; "abcdefghijklmnopqrstuvwxyz012345";
static const char cb32_ucase[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ012345";
static unsigned char rev32[128]; static unsigned char rev32[128];
static int base32_decode(void *, size_t *, const char *, size_t); static int base32_decode(void *, size_t *, const char *, size_t);
@ -80,6 +82,8 @@ base32_reverse_init()
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
c = cb32[i]; c = cb32[i];
rev32[(int) c] = i; rev32[(int) c] = i;
c = cb32_ucase[i];
rev32[(int) c] = i;
} }
reverse_init = 1; reverse_init = 1;
} }