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

Generate CRC32 checksum of file swift

I have a .zip file inside the project and I am transferring it to the external ESP32 via Bluetooth. But I need to send the CRC-32 checksum at the end of the sending file. I don't have any idea how to generate it. Can anyone help me with how to do it…
RushDroid
  • 1,570
  • 3
  • 21
  • 46
-1
votes
1 answer

can same input data have different CRC value?

I have implemented one TCP client-server module in C which process certain data. each server and client checking CRC32 value of packet before proceeding further. Here client and server running my PC and both are using same CRC algorithm. Now one…
user2520119
  • 173
  • 11
-1
votes
1 answer

How to use this Crc32 class in my own code

I need to use this class: Source: http://www.sanity-free.com/12/crc32_implementation_in_csharp.html public class Crc32 { uint[] table; public uint ComputeChecksum(byte[] bytes) { uint crc = 0xffffffff; …
Daniel Y
  • 13
  • 2
-1
votes
1 answer

CRC - Python - How to calculate JAMCRC decimal number from string

I need to calculate CRC-32/JAMCRC decimal number from a string in Python 3. How can I do it? For example, this webpage does it: https://www.crccalc.com/ - for 'hello-world' it prints 1311505828. I would like to have script which does exactly the…
Marek
  • 53
  • 1
  • 7
-1
votes
1 answer

Revers Engineering CRC 32 in firmware

i have a p-flash (size is about 700kb) in this flash there is a CRC32. I know where it is, and i know the CRC calculation method (polynomial, initial value, final Xor Value, input and output reflected) the problem is that just a part of these 700kb…
rrdesign
  • 11
  • 2
-1
votes
1 answer

Is it possible to parallelize this loop in python?

I've been working on a program to obtain a rainbow table, using a crc32 hash. The main loop of the program is the following: from zlib import crc32 from string import ascii_lowercase from itertools import product ... rt = {} i = 0 for p in…
Atalajaka
  • 125
  • 1
  • 2
  • 14
-1
votes
1 answer

How checksum is calculated?

When I use hdfs dfs -checksum /file.txt in terminal, it gives /file.txt MD5-of-0MD5-of-512CRC32C 000002000000000000000000ccfadcfdcff630efa5628fb72620d535 How it was calculated? Upto my understanding, crc-32 used to calculate the checksum of the…
-1
votes
1 answer

I can't recalculate CRC32 checksum for a CD-ROM sector

I managed extracted a single sector from a cd-rom bin file using a hex editor. According to cd-rom specifications the sector should have the following format: * 16 bytes for synchronization and header * 8 bytes for the sub-header * 2048 bytes for…
-1
votes
1 answer

How to divide input in parallel crc?

I am trying to understand the working of a parallel crc using look up tables, I could get the basic sarwate code running correctly but I am having a lot of confusion when it comes to appending or prepending zeros. I am trying to use this code for a…
Ashley
  • 13
  • 5
-1
votes
1 answer

using srec_cat to fill an S-Record file with a word

I have an input file in S-Record format whose unused area needs to be filled with a given word pattern [lets say 0xAABBCCDD] using srec_cat.exe. I am trying the following syntax srec_cat.exe -fill -within …
user1771823
  • 139
  • 1
  • 13
-1
votes
2 answers

What does mask variable do in this CRC checksum calculation?

The question is about code in figure 14-6 in here. The mask is calculated as: mask = -(crc & 1) Why do we & crc with 1 and then make result negative? The Figure 14-5 does not have this mask variable, why? Edit: So since this point is clear, why do…
quantum231
  • 2,420
  • 3
  • 31
  • 53
-1
votes
1 answer

I need CRC Reverse Code for my CRC64 Checksum Coding

Can someone please code me the CRC64 Reverse Algorithm in C#? I am unable to code it, can't understand anything. Thanks, I have copied the CRC64 Checksum code from C++ and converted it into C# .NET. The entire code is displayed below: using…
Tush
  • 153
  • 3
  • 13
-1
votes
1 answer

Generate a 1-5 number from a byte array

I have the need to consistently generate a number between 1-5 from a byteArray input. I was thinking to use a CRC32 checksum so I have a long number. I would need to translate the long to something between 1-5. Is it a good solution? How could I…
spike07
  • 809
  • 2
  • 12
  • 21
-1
votes
1 answer

Convert this CRC32 algorithm to Python 3.3

I need to convert this CRC32 algorithm to python (using 3.3), but I am a python noob. I tried the built in binascii.crc32(), but the CRC was incorrect. Apparently, STMicro does the CRC32 a bit different. I found an algorithm that works, now I just…
-1
votes
1 answer

Generate CRC in Java and C

Here my code in C. unsigned int crc32b(unsigned char *message) { int i, j; unsigned int byte, crc, mask; i = 0; crc = 0xFFFFFFFF; while (message[i] != 0) { byte = message[i]; // Get next byte. crc = crc ^…
Hu hu
  • 49
  • 1
  • 1
  • 5
1 2 3
37
38