crc

TinyOS CC2420ReceiveP

I want to hold onto packets that fail the crc check. To do this I have commented out a section of the CC2420RecieveP readDone function that checks the msb bit of the LQI byte in the received buffer. I think this is working, However, once I receive the packet in my own receive function I send it through the serial component (not just th...

How could I guess a checksum algorithm?

Let's assume that I have some packets with a 16-bit checksum at the end. I would like to guess which checksum algorithm is used. For a start, from dump data I can see that one byte change in the packet's payload totally changes the checksum, so I can assume that it isn't some kind of simple XOR or sum. Then I tried several variations o...

How to change NSIS Error message about CRCCheck

Some of my users are complaining about some odd errors my installers had after downloading them from my web server. This are NSIS installer that when downloaded came crippled or incomplete (usually because of slow Internet connections), the message is very clear "The installer you are trying to use is corrupted or incomplete....." IN EN...

How to calculate CRC_B in C#

How to calculate CRC_B encoding in C# as described in ISO 14443? Here is some background info: CRC_B encoding This annex is provided for explanatory purposes and indicates the bit patterns that will exist in the physical layer. It is included for the purpose of checking an ISO/IEC 14443-3 Type B implementation of CRC_B encodi...

CRC preset and residue

Hi, I am working with a device that requires me to generate a 16 bit CRC. The datasheet for the device says it needs the following CRC Definition: CRC Type Length Polynomial Direction Preset Residue CRC-CCITT 16 bits x16 + x12 + x5 + 1 Forward FFFF (16) 1D0F (16) where preset=FFFF (16 bit) and Residu...

CRC checks for files

I'm working with a small FAT16 filesystem, and I want to generate CRC values for indidual XML files which store configuration information. In case the data changes or is corrupted, I want to be able to check the CRC to determine that the file is still in it's original state. The question is, how do I put the CRC value into the file, wit...

tricky crc algorithm

Hi, I am trying to find the crc that works with the following results. The byte string consists of 4 bytes (ie. CE1E) and the crc is an single byte (ie. 03) byte crc CE1E 03 CE20 45 CE22 6F 0000 C0 0001 D4 FFFF 95 Can anyone help? ...

How could I guess a checksum algorithm?

Hi, does anybody know how to figure out the CRC algorithm if a given code + CRC string is given? I have got several strings consisting of code + matching CRCs but don´t know how to calculate the CRC in question so that I could produce more code strings. Here are some samples (16bit code + 4bit CRC): 0010101000011101 + 0000 0010101000011...

How do you compute the XOR Remainder used in CRC?

I'm trying to remember how the math is worked out to compute the remainder of an XOR algorithm in Cyclical Redundancy Checks to verify the remainder bits of a network message. I shouldn't have tossed that text book. This is easily done in code, but how is it worked out by hand? I know it looks something like a standard division algori...

Determining CRC algorithm from data + CRC - embedded application.

Hello, I have a set of data protected by 16bit checksums that I need to correct. The checksum locations are known, the exact areas they are calculated on and the exact algorithm used to calculate them are not. 16bit, LSB first. I suspect it's some sort of 16bit CRC, but I have not been able to find the code that's actually calculatin...

CRC8-Check in PHP

How can I generate a CRC-8 checksum in PHP? ...

How would I get a Hash value of a users file with Javascript or Flash?

What I need to do is provide a file browser box on a web page where a user selects a file from their computer and, through javascript (or flash if necessary), some sort of Hash is returned such as CRC, MD5 or SHA1. I would prefer not to have to upload the entire file to the web server, as I expect some rather large files to be used in th...

CRC Calculation

I'm trying to interface with a 3rd party system and they have provided a code sample to calculate a CRC value when sending text data. The C code the vendor provided looks like this: #define CRCRES 0xf0b8 /* residue for good verify */ #define DEBUG unsigned crctbl[] = {0x0000, 0x1081, 0x2102, 0x3183, 0x4204, 0...

Java Unsigned Char Array

I'm working on a project fuzzing a media player. I wrote the file generator in Java and converted the CRC generator from the original compression code written in C. I can write data fine with DataOutputStream, but I can't figure out how to send the data as an unsigned character array in java. In C this is a very straightforward proces...

Runtime CRC checking

Q. I have a hex code running on a machine. How do I calculate the checksum of the entire code at runtime? ...

CRC calculation in Java

Hi, i'm readin file from serialport using x-modem protocol and 133 bytes packet i'm reading in that 1 byte is SOH 2 byte packet number 3 byte nagative of packet number next 128 bytes data 2 bytes CRC sent from other side. i've to calculate CRC of 128 bytes data and 2 bytes crc sent form other side that i've to m...

checksum calculation

To calculate CRC I found a piece of code but I am not understanding the concept. Here is the code: count =128 and ptr=some value; calcrc(unsigned char *ptr, int count) { unsigned short crc; unsigned char i; crc = 0; while (--count >= 0) { crc = crc ^ (unsigned short)*ptr++ << 8; i = 8; ...

What is a running CRC?

I have searched and am not able to find information on what it is and how it is computed. ...

When is CRC more appropriate to use than MD5/SHA1?

When is it appropriate to use CRC for error detection versus more modern hashing functions such as MD5 or SHA1? Is the former easier to implement on embedded hardware? ...

CRC error-correction library?

Is there a CRC library that enables the user not only detect errors but also correct them? I'm looking for a C/C++ or Java library, ideally open-source. ...