I’m trying to find a CRC32 computation algorythm that output data in positive 8-character HEX (like winrar CRC for example).
All algorythms found return a positive/negative integer that I don’t know how to handle…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ll bet that all of the CRC32 algorithms you found return a 32-bit integer (e.g.
intoruint). When you view it, you’re probably viewing it as a base-10 number. By viewing I mean formatting the integer as a string without passing any format options toInt32.ToStringorString.Format.If you were to put Visual Studio into Hexadecimal View, you would get your “expected” output. The algorithms are all correct in this case, however, it is your expectation that is incorrect!
Instead, use a Number Format which produces the string representation you desire: