1 2 Previous Next 17 Replies Latest reply: May 1, 2006 12:04 AM by 843853 Go to original post RSS
      • 15. Re: CRC32C checksum in Java
        843853
        I just thought of something. I tried byte swapping the result
        from the first test and adding it to resulting test data like this:

             byte[] rawData = {
             0x01, (byte)0xC0, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00,
             0x01, (byte)0xFE, 0x60, (byte)0xAC,
             0x00, 0x00, 0x00, 0x08,
             0x00, 0x00, 0x00, 0x04,
             0x00, 0x00, 0x00, 0x09,
             0x25, 0x00, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00,
             (byte)0xeb, 0x75, 0x4f, 0x66
        };

        and got a result of 0. So, maybe I have to byte swap the result?

        If that's the case, is the test data in network (big endian) order? or does
        it need to be swapped also, perhaps? I'll try that and see what happens

        Thanks,
        Eric
        • 16. Re: CRC32C checksum in Java
          843853
          and get the results, in this case 0x664f75eb, that
          you should be able
          to append that result to the original data, run the
          test again and get a result of 0.
          No!

          <snip>
          Am I misunderstanding
          omething about how CRC32C works, or is there a
          problem with the code?
          You are 'misunderstanding somthing'!
          • 17. Re: CRC32C checksum in Java
            843853
            I suspect your test is invalid ...
            This implementation does ultimately work. I accidentally munged some of
            my test data for a while (which caused no end of grief). But then I went back
            to the iSCSI rfc and realized that I also need to take the results from the above code, do a 1s complement on it and byte swap it. After all that, the
            results match test data.

            Thanks for the help!!
            Eric
            data on one run and then

            Edited by: EJP on 9/02/2012 10:04: redacted
            1 2 Previous Next