From 55c96d623dbc0043203cbdaf4dad4192efdc8e65 Mon Sep 17 00:00:00 2001 From: cospplredman Date: Sun, 21 Apr 2024 16:15:11 -0500 Subject: [PATCH] implemented cksum --- src/cksum/Makefile | 5 +++++ src/cksum/cksum | Bin 0 -> 15800 bytes src/cksum/cksum.1 | 1 + src/cksum/cksum.c | 26 ++++++++++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 src/cksum/Makefile create mode 100755 src/cksum/cksum create mode 100644 src/cksum/cksum.1 create mode 100644 src/cksum/cksum.c diff --git a/src/cksum/Makefile b/src/cksum/Makefile new file mode 100644 index 0000000..f84ebce --- /dev/null +++ b/src/cksum/Makefile @@ -0,0 +1,5 @@ +OUT := cksum + +SRC := cksum.c + +include ../shared.mk diff --git a/src/cksum/cksum b/src/cksum/cksum new file mode 100755 index 0000000000000000000000000000000000000000..60f4b965d759eeaf9d16a4a0aa81533137b4beb3 GIT binary patch literal 15800 zcmeHOYj7LY6~0m|VnZxB0T)AnXdq^iwpOgzaUBvjk{`($oJWn5@Cu7!$+n6u8EKU| z8K!vZn4&SJ=?^F^bfD88X_@IvTRJI)c90!UY==S}(xK__qaLPExx7rFm}j=%*}X@W z7YCSj+UbuyGrQkC-#zEvbI;yg-IcEHYHHc)bT|ad67f|*TK|P66Oa|PHL?H*h+0vM z^A+N9aUS#ngEQ*`CZN`oGtPxrDETEo@++glB6yie3r3ERko?XiXDA>DqbMQ+q4Mj5$2*PoZ1AztI0!!j~}Fy{MFC{qYvF&Vzg^O=#cMPpthm~w1ta(O zHTcO(D=j`9_%gT3{?2tBDrNo|Wm?6$?&$uS>UG`WitcDE)mPD1TT@X}?Mude>y3^n zu1XvgW4n;65_ZG(y5LQ(m$^(hvAAvjBf(xU4*AmFJ^z>9QGHS!=7SYtewGgv~v~s zD{)wb=E7p_h)7>l6P*#QU3A2IBQc?>xRUK^QVS(CwI>uMroAtuc0^;L?&zV2=uJdp zT8AJjy1X@FTT63&gSy_g-nSuFuBsMlbK7<`97#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ff --git a/src/cksum/cksum.1 b/src/cksum/cksum.1 new file mode 100644 index 0000000..fca0bf6 --- /dev/null +++ b/src/cksum/cksum.1 @@ -0,0 +1 @@ +\" TODO \ No newline at end of file diff --git a/src/cksum/cksum.c b/src/cksum/cksum.c new file mode 100644 index 0000000..79c4500 --- /dev/null +++ b/src/cksum/cksum.c @@ -0,0 +1,26 @@ +#include +#include + +#define NAME "cksum (canoutils)" +#define VERSION "0.0.1" +#define AUTHOR "cospplredman" + +#include"../version_info.h" + +#define X(a,...) for(a)for(r=(r<<8)^(e&0xff)^__VA_ARGS__,e=0,i=31;i>23;i--)if(r&(1<>(32-i)),e^=q<<(i-24); + +uint32_t q=0x04c11db7,r,e;d,i=1,t,j,k,f=2;main(c,v)char**v;{ + if(c<2)exit(1); + for(;++k=0;t++,d)X(j=t;j;,(j&0xff),j>>=8)X(j=3;j--;,0) + if(printf("%u %d %s\n",~((r<<8)|(e&0xff)),t,v[k])<0)exit(1); + r=e=t=0; + } +}