MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / init_decode_table

Function init_decode_table

test/benchmark/base64.c:25–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void init_decode_table() {
26 for (int i = 0; i < 256; i++) {
27 char ch = (char)i;
28 char code = -1;
29 if (ch >= 'A' && ch <= 'Z') code = ch - 0x41;
30 if (ch >= 'a' && ch <= 'z') code = ch - 0x47;
31 if (ch >= '0' && ch <= '9') code = ch + 0x04;
32 if (ch == '+' || ch == '-') code = 0x3E;
33 if (ch == '/' || ch == '_') code = 0x3F;
34 decode_table[i] = code;
35 }
36}
37
38#define next_char(x) char x = decode_table[(unsigned char)*str++]; if (x < 0) return 1;
39

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected