summaryrefslogtreecommitdiff
path: root/task1.c
diff options
context:
space:
mode:
Diffstat (limited to 'task1.c')
-rw-r--r--task1.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/task1.c b/task1.c
new file mode 100644
index 0000000..886365b
--- /dev/null
+++ b/task1.c
@@ -0,0 +1,22 @@
+#include "lib.h"
+
+
+int main(int argc, char **argv)
+{
+ if (argc != 2)
+ return 0;
+
+
+ char *result = malloc(strlen(argv[1]));
+ char *base64 = malloc(strlen(argv[1]));
+
+ decode_hex_string(argv[1], result);
+ encode_to_base64(result, base64);
+
+ printf("%s\n", base64);
+
+ free(result);
+ free(base64);
+ return 0;
+
+}