Questions tagged [crc32]

A cyclic redundancy check (CRC) is an error-detecting code designed to detect accidental changes to raw computer data, and is commonly used in digital networks. (wiki) A CRC32 algorithm typically takes in a file stream or character array and calculates an unsigned long codeword from the input. One can transmit this codeword and re-calculate it on the receiver end, then compare it to the transmitted one to detect an error.

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data. Blocks of data entering these systems get a short check value attached, based on the remainder of a polynomial division of their contents; on retrieval the calculation is repeated, and corrective action can be taken against presumed data corruption if the check values do not match. wikipedia

The most commonly used polynomial lengths are:

  • CRC-8: 9 bits
  • CRC-16: 17 bits
  • CRC-32: 33 bits
  • CRC-64: 65 bits

A truly excellent tutorial on CRC's is Ross Williams' "Painless Guide to CRC Detection Algorithms", which can also be found here, here, here, here, and here.

570 questions
-1
votes
1 answer

How can I calculate a CRC-32 on an NSData object in Objective C?

I have tried using the crc32( ) function in zlib, but it fails to link because _crc32 is an undefined symbol for architecture arm64.
-1
votes
1 answer

PHP: How to use %u in crc32 function

my auth not working like, my code is below.
Dark Cyber
  • 2,181
  • 7
  • 44
  • 68
-1
votes
1 answer

Arduino CRC32 Code Explanation searched

I've started with Arduino and the next task I set to myself is to unterstand how a CRC check could be implemented. I think I've found a decent code for that. But simply implementing...no, I want to learn. I searched a bit on CRC in general and I…
mathnow
  • 1
  • 2
-1
votes
1 answer

Diffrent result for CRC32 in c++ and java

I am trying to calculate CRC32 checksum in C++. But i'm still getting bad results. C++ code: class CRC32 { public: CRC32() { unsigned int poly = 0xedb88320; unsigned int temp = 0; for(unsigned int i = 0; i < 256; ++i)…
-1
votes
2 answers

printf hex value output seemed bigger than is should

I have a function that calculate a 32 bit CRC, I have an internal variable to a class that hold the CRC. the function that validate CRC consistency return a boolean result of the class CRC with what the class is calculating, the member function…
aah134
  • 860
  • 12
  • 25
-2
votes
1 answer

CUDA C - CRC32 - Finding unknown polynom and crcxor - program speed up

I was looking for questions related to my problem but only found questions regarding CRC32 reversing. My topic is a bit different. I am a novice programmer and I have such a task to do. I have input (3 strings of 4 bytes). For this data, I know…
th3r4t3l
  • 17
  • 5
-2
votes
2 answers

CRC64 calculation in VB

I'm using the code I found [here][1] tot calculate a CRC32 checksum. I would also like to calculate a CRC64 checksum. But I can't figure out how to do this. Any help would be appreciated! Below the code from "Magnus" I'm using for CRC32. Private…
Womabre
  • 9
  • 1
-2
votes
1 answer

How to adjust the reconcilation factor calculation for a CRC32 to a CRC16?

In my Project i need to append one byte to a data buffer. If I add this extra byte this would cause a change of the crc checksum. In order to prevent a change I have to calculate a reconcilation factor which is appended to the end of the data. The…
Philipp Fu
  • 75
  • 1
  • 6
-2
votes
2 answers

a document (a buffer of ASCII bytes) which has the CRC32 hash (the gzip variant of CRC32), of 0xbbd1264f

so i had a homework to get a document (a buffer of ASCII bytes) which has the CRC32 hash (the gzip variant of CRC32), of 0xbbd1264f and unti now i don't know how to get it so if someone know how to do that please answer
the gamer
  • 3
  • 1
-2
votes
1 answer

Compute a CRC32C (Castagnoli) which uses the generator polynomial 1EDC6F41h following Rocksoft Model CRC Algorithm in Python

I did explore Crcmod python library but couldnt use it as my gen poly- 0x1EDC6F41 is not considered a 32 bit poly :( Is there a way to tweak it or any other python lib that I can use to do this? Name : "CRC-32C" Width : 32 Poly : 1EDC6F41h Init :…
kate
  • 113
  • 1
  • 5
  • 17
-2
votes
2 answers

Reverse Engineering a CRC Packet

I'm new to reversing. I need to analyse a packet which i think is checked by CRC. The packet is the following: …
pugilon
  • 87
  • 1
  • 2
  • 12
-3
votes
1 answer

How to calculate CRC32 correctly?

item = '04010034587C1F0C6D51B6D33B78CA63C1CC7E5910006C5600000000000000' '%08X' % (binascii.crc32(binascii.a2b_hex(item)) & 0xffffffff) I can't get the crc32 to give me the correct 32 bits. I have tried several different algorithms. I have been…
TWagner
  • 69
  • 1
  • 8
-4
votes
2 answers

How to calculate a CRC-32 from 16-bit data?

How would I (in C/C++) calculate the CRC32 from the following 16-bit data? The data is: 0x0000, 0x083A, 0x0000, 0xFFF7, 0x0000, 0xFFFE, 0x0000, 0x0001, 0x5001, 0x0003, 0xE00A, 0x0015, 0xC009, 0x0320, 0x8A54 I assume the CRC32 = 0xB6C815B4 according…
Eerik Sweden
  • 375
  • 6
  • 17
-5
votes
1 answer

convert crc javascript func to c$ func

i have a problem whit c#, please someone convert this javascript function to c#. function mycrc(str) { var c; var crcTable = []; for(var n = 0; n < 256; n++){ c = n; for(var k = 0; k < 8; k++){ …
1 2 3
37
38