crc32/README.md

39 lines
1.1 KiB
Markdown
Raw Normal View History

2012-04-13 02:49:53 -07:00
crc32
2012-04-13 03:18:52 -07:00
=====
2012-04-13 02:49:53 -07:00
2012-04-13 12:54:53 -07:00
A [crc32][crc] calculator written in C and licensed under the [GPLv3.][gpl]
2012-04-13 02:49:53 -07:00
2012-04-13 03:18:52 -07:00
[crc]: http://en.wikipedia.org/wiki/Cyclic_redundancy_check
[gpl]: http://www.gnu.org/licenses/gpl.txt
2012-04-13 02:49:53 -07:00
Compilation
2012-04-13 03:18:52 -07:00
-----------
2012-04-13 02:49:53 -07:00
gcc -ansi -pedantic -Wall -Werror -O3 main.c -o crc32
or for Visual Studio users
cl /O2 /Ot /W2 /WX /Fecrc32 main.c
2012-04-13 12:54:53 -07:00
Usage
2012-04-13 03:18:52 -07:00
----
2012-04-13 12:54:53 -07:00
crc32 - 32-bit cyclic redundancy check calculator
2012-04-13 03:18:52 -07:00
-h, --help display this text
2012-04-13 12:54:53 -07:00
--license show copyright & license information
2012-04-13 03:18:52 -07:00
-i, --input f open file f for reading (default: stdin)
-s, --start-at n start cycle with n (default: 0xFFFFFFFF)
2012-04-13 12:54:53 -07:00
-p, --polynomial n use n as the crc divisor (default: 0x04C11DB7)
2012-04-13 03:18:52 -07:00
-e, --big-endian use big endian calculations (default: little)
-b, --binary output as binary (default: hex with newline)
-x, --xor xor the output by 0xFFFFFFFF
-r, --reflect reverse the bits of the output
numbers (n) can be entered as hexadecimal or octal with prefixes
2012-04-13 02:49:53 -07:00
Notes
2012-04-13 03:18:52 -07:00
-----
2012-04-13 02:49:53 -07:00
2012-04-13 03:18:52 -07:00
* Does not pad input.
2012-04-13 12:54:53 -07:00
* Big endian calculations may be inaccurate. I'll look into this.