473,395 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 3918
Banfa
9,065 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

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

Similar topics

8
by: Ricky Romaya | last post by:
Hi, I'm working on a file upload script. I need to calculate the CRC32 of the file(s) which are successfully uploaded. How can I do this? PHP only have CRC32 function for strings. However, the...
1
by: PaullyB | last post by:
Hi, I am attempting to convert the following code written in c to equivalent java code. This is the CRC32 algorithm used by a GPS received I am interfacing with. Unfortunately, the CRC32 class...
2
by: nobody | last post by:
1) Does anyone know if the CRC32 algorithm in binascii has a name? There seem to be a TON of different CRC32 methods; different polynomials, different byte orders, different seeds, some flip the...
6
by: Weiguang Shi | last post by:
Hi there, I'm thinking of using binascii.crc32 as a hash-function when I read in the reference http://www.python.org/doc/current/lib/module-binascii.html: crc32( data) Compute CRC-32, the...
14
by: Don | last post by:
Hi NG. Does anyone know of a place where I could download/get a C implementation of a CRC32 check. I would like a simple function that, for example, had a pointer to where the data to be CRC32...
9
by: UnixUser | last post by:
I am looking for some source code to run on Linux that will enable me to calculate and return a CRC32 value from a string of text. I have found one from snippets.org, but I cannot get it to...
1
by: Matthew Wilson | last post by:
I need to write a function crc(msg, len) that gets a char array of length len and then calculates the crc32 for the code. I don't understand what's going wrong in the code I have. It goes...
3
by: Russell Mangel | last post by:
Hi, I would like to encapsulate the following CRC32 routine inside a C++ un-mananged class. I am having difficulty initializing the "const static unsigned int table" inside an un-managed C++...
12
by: Larry Bates | last post by:
I'm trying to get the results of binascii.crc32 to match the results of another utility that produces 32 bit unsigned CRCs. binascii.crc32 returns results in the range of -2**31-1 and 2**21-1....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.