-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented cksum #40
Conversation
src/cksum/cksum
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the binary file and add it to gitignore list.
Make sure to add your the folder name in BINS
variable of the global Makefile
src/cksum/cksum.c
Outdated
@@ -0,0 +1,101 @@ | |||
#include<stdint.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run clang-format
? This enforce coding style consistency across all sources
The core logic is a bit cryptic (mostly bit manipulation) so I couldn't tell what happening there |
bro i swear i did git rm
bro i swear i did git rm
hello @cospplredman. thanks for your pr. please test this before we merge it. Also, be sure to provide. if you tasted all the edge cases, mention me so I can merge it. ;) |
My testing methodology is as follows: run both my implementation and the gnu implementation on every file in the cksum directory. $ ./cksum *
175369053 16296 cksum
1855786587 7 cksum.1
4088649404 2179 cksum.c
1192622583 51 Makefile
197436690 157 test.sh
$ cksum *
175369053 16296 cksum
1855786587 7 cksum.1
4088649404 2179 cksum.c
1192622583 51 Makefile
197436690 157 test.sh the results match as far as i can tell. One notable difference between this implementation and the gnu implementation is that I do not handle directories, I opt to instead just return EXIT_FAILURE. The reason I prefer to fail is that there isn't a standard C way of checking if something is a directory, so any method of doing so would break me from my (very tasteful) c99 compliance, and cksum is only defined on files anyways. |
do you handle flags? |
also pull the latest changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx ;)
cksum is one of the posix utilities of all time.