468,513 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

CRC32 for a unsigned array in C++

2
Hi

I need to calculate the crc32 value for an unsigned array in C++.It goes like this..

unsigned char Myarray[16];

//Myarray contains hex value ... b525b4d0ad533acee2d6a214453a279e

Need to calculate the crc32 value for this Myarray[].
------------------------------------------------------------------------------------------
Have done something like this in java

bytes = md.digest( request.getBytes() );
// bytesToHex(bytes) -------> b525b4d0ad533acee2d6a214453a279e
CRC32 crc=new CRC32();
crc.reset();
crc.update(bytes);
checksum = crc.getValue(); // gives checksum as ---> 2422938937

-------------------------------------------------------------------------------------------
Need to get same value in C++ for the above mentioned Myarray[].

Thanks in advance. :)
tlsk
Nov 15 '07 #1
2 3343
Banfa
9,056 Expert Mod 8TB
If you can't be bothered to write the algorithm yourself (and TBH I wouldn't bother) then I suggest you search for an implementation on the web. I find Wikipedia a good place to start for this sort of thing.

Oh and CRC32 isn't very descriptive as there are at least 4 different 32 bit CRCs functions in common usage.
Nov 15 '07 #2
tlsk
2
Thanks for the advice.. but i figured it out...!!
Nov 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Ricky Romaya | last post: by
1 post views Thread by PaullyB | last post: by
6 posts views Thread by Weiguang Shi | last post: by
14 posts views Thread by Don | last post: by
9 posts views Thread by UnixUser | last post: by
1 post views Thread by Matthew Wilson | last post: by
12 posts views Thread by Larry Bates | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.