From 07f78f990a68eda368d3e195edf34d42a196583e Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 16 Nov 2020 00:53:44 +0000 Subject: added a shorten program that I use in except for making shortened links on epo.k.vu --- shorten.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 shorten.c (limited to 'shorten.c') diff --git a/shorten.c b/shorten.c new file mode 100644 index 0000000..ac76d84 --- /dev/null +++ b/shorten.c @@ -0,0 +1,37 @@ +#define _POSIX_C_SOURCE 200908 +#include +#include +#include +#include +//#include +#include + +#define BYTES_IN_SHORT 2 +#define CACHE_DIR "/var/cache/shorten" + +int main(int argc,char *argv[]) { + int i; + if(argc < 2) return 1; + unsigned char *p=MD5((unsigned char *)argv[1],strlen(argv[1]),NULL); + char filepath[4096];//too long, oh well + char out[256]; + char tmp[3]; + strcpy(out,""); + for(i=0;i