PaulC has asked for the wisdom of the Perl Monks concerning the following question:
I need to write a program that computes a CRC on an input file. The program should accept command-line arguments that give the input file name and an optional output file name.
If there are two filename arguments, then it should assume that the input file is a "normal" file without any CRC code attached to it. It should compute a CRC and append the computed remainder (the CRC code) to the end of the output file in the last two bytes. If there is one filename argument, then it should assume that the input file contains a computed CRC. Thus, it should perform a checking action by recomputing the CRC and determining whether the resulting remainder is zero. If there are two filename arguments, then the output file is essentially the same as the input file, except that it has the computed CRC appended to the end. If there is one filename argument, then the output is to the screen: the program reports whether an error was detected. All help is welcome=)
Edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: crc-16 help
by lhoward (Vicar) on Jun 12, 2001 at 20:07 UTC | |
|
Re: crc-16 help
by bikeNomad (Priest) on Jun 12, 2001 at 20:03 UTC |