diff options
author | phoebos <ben@bvnf.space> | 2021-07-06 20:27:15 +0100 |
---|---|---|
committer | phoebos <ben@bvnf.space> | 2021-07-06 20:27:15 +0100 |
commit | 0b5f803354afe70a0648882e26078374bc4d9fc4 (patch) | |
tree | f69c41ef5576ffcfe167eb544b02f7c25800f1c9 | |
parent | bc4022292b3366ef3f4dfbdd1347aa15c8297e83 (diff) | |
download | kandr-0b5f803354afe70a0648882e26078374bc4d9fc4.tar.gz |
base64: add lookup table
-rw-r--r-- | base64.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/base64.c b/base64.c index ce4f4c7..5af13a7 100644 --- a/base64.c +++ b/base64.c @@ -26,6 +26,18 @@ #define BUF_SIZE 1000 +const char tbl_base64[] = { + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', + 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', + 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '+', '/', + '=' /* termination character */ +}; + static void usage(const char *name) { fprintf(stderr, "usage: %s [-d] [FILE]\n", name); } |