Closed setop closed 7 years ago
Hi setop, thanks for the feed-back, I'm glad pycrc was useful. I'm not sure how to procede with this bug though. The example main() is supposed to be just that, an example and to show the very basic usage of pycrc and not to do anything useful. Also as a new user I wouldn't know whether the program is busy calculating or just waiting for an input.
Unless I'm missing the main point of the bug -- let me know --, I'm tempted to close wontfix this bug.
PS:
there is a small error in the code. The buffer should be declared as char buffer[BLOCK_SIZE];
i.e. without the asterisk.
As a new user, I was surprised "generate main" only produce a hard coded test and not something that can be used for real.
What I propose is very basic but is does the job : produce the CRC of the stdin to stdout. It could be stated as this in the documentation or the help.
What pycrc currently produce is more like a test and it could be called like this.
Fill free to close wontfix. I won't mind. If a user are looking for a practical main function, she will be able to find it here.
PS : thanks for the fix. I'm definitely not a C expert and this asterisk is a vestige of an attempt to put code snippets together.
Hi setop, I have added the example program as https://pycrc.org/example-stdin.html Thanks again for your feed-back!
That's good news.
May I add a small remark :
./crc < file
or
<produce some bytes> | ./crc
would be a better illustration of the usage. It avoids to use CTRL+D and allows any binary content.
Should be all set now. Thanks for your help!
Nice tool ! I needed to implement Zip CRC and it worked. Thanks
However, I found the generated main function not so useful. I propose :
which prints crc of stdin to stdout.