bmanske
09-30-2006, 11:11 PM
I started working with PPL and the first thing I noticed was the abseence of bit manipulation operators.* I explained to Kornalius what was needed, he made it a reality and I set out to test it using this program.</p>
*In case you are not familiar with a CRC, it is a Cyclic Redundancy Check.* This CRC generator creates a number that is 32 bits (4 bytes) in length.* It is implemented in hardware in almost every network card in the world and in software in programs like WinZip to verify that the data in the file is valid.</p>
Just download the attached file and unzip it.* I included the test file (a wav) that I have been using, but it can work with any file, just change the filename in the define at the top of the program.* It demonstrates the use of the console, using sprintf to format output strings, how to read from a file and of course bit manipulation.</p>
There is just one problem, it doesn't work.* Yep.* Last night I sat for about 2 hours looking at this code wondering why it didn't work.* I hadn't compiled or run it in a long time.* Some bug that was allowing it to work before, was fixed in the compiler and now it fails to generate a good CRC.* I figured, "Why should I alone have all of the fun?"</p>
Here is the challenge, fix the CRC bug.* All of the CRC values that get printed by each of the 4 methods*are all different now.* After the fix they will all be the same.* Here is the hint: all you have to do is open the file add only ONE character then save and run the file.</p>
Understanding why this is happening requires some pretty good understanding of bit-manipulation.* Who will be the first to post the solution?* If this isn't answered in a week, I will post the solution with an explanation.* Anybody want to play?</p>[br]1159653991_5_FT0_crc32.zip [/html]
*In case you are not familiar with a CRC, it is a Cyclic Redundancy Check.* This CRC generator creates a number that is 32 bits (4 bytes) in length.* It is implemented in hardware in almost every network card in the world and in software in programs like WinZip to verify that the data in the file is valid.</p>
Just download the attached file and unzip it.* I included the test file (a wav) that I have been using, but it can work with any file, just change the filename in the define at the top of the program.* It demonstrates the use of the console, using sprintf to format output strings, how to read from a file and of course bit manipulation.</p>
There is just one problem, it doesn't work.* Yep.* Last night I sat for about 2 hours looking at this code wondering why it didn't work.* I hadn't compiled or run it in a long time.* Some bug that was allowing it to work before, was fixed in the compiler and now it fails to generate a good CRC.* I figured, "Why should I alone have all of the fun?"</p>
Here is the challenge, fix the CRC bug.* All of the CRC values that get printed by each of the 4 methods*are all different now.* After the fix they will all be the same.* Here is the hint: all you have to do is open the file add only ONE character then save and run the file.</p>
Understanding why this is happening requires some pretty good understanding of bit-manipulation.* Who will be the first to post the solution?* If this isn't answered in a week, I will post the solution with an explanation.* Anybody want to play?</p>[br]1159653991_5_FT0_crc32.zip [/html]