forked from cory/tildefriends
Merge branches/quickjs to trunk. This is the way.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3621 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
22
deps/base64c/test/gen.c
vendored
Normal file
22
deps/base64c/test/gen.c
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
static const unsigned char base64_table[65] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
int main() {
|
||||
unsigned char out[256];
|
||||
|
||||
memset(out, 0x80, 255);
|
||||
for (int i = 0; i < 64; i++) {
|
||||
out[base64_table[i]] = i;
|
||||
}
|
||||
out['='] = 0;
|
||||
|
||||
printf("static const unsigned char base64c_dtable[256] = {");
|
||||
for (int i = 0; i < 256; i++) {
|
||||
if (i% 20==0) { printf("\n"); }
|
||||
printf("/*%03d*/0x%02x,", i, out[i]);
|
||||
}
|
||||
printf("\n};");
|
||||
}
|
Reference in New Issue
Block a user