crc

Can zlib.crc32 or zlib.adler32 be safely used to mask primary keys in URLs?

In Django Design Patterns, the author recommends using zlib.crc32 to mask primary keys in URLs. After some quick testing, I noticed that crc32 produces negative integers about half the time, which seems undesirable for use in a URL. zlib.adler32 does not appear to produce negatives, but is described as "weaker" than CRC. Is this method...

Find out CRC or CHECKSUM of RS232 data

I need to communicate with a RS232 device, I have no specs or information available. I send a 16 byte command and get a 16 byte result back. The last byte looks like some kind of crc or checksum, I have tried using this http://miscel.dk/MiscEl/miscelCRCandChecksum.html with no luck. Anyone can reverse engineer the crc/checksum algorit...

CRC for cross platform applications

I wish to use common CRC logic in a VB.NET or C# application as well as on a C/Linux application. I have one C/Linux application that interacts with a webservice (written in C#) and also a web application (written in VB.NET). For some data, I want to add a CRC to the data itself (say a file) from the .NET side and check for the integrity...

Convert CRC-CCITT Kermit 16 DELPHI code to C#

I am working on a function that will give me a Kermit CRC value from a HEX string. I have a piece of code in DELPHI. I am a .NET developer and need the code in C#. function CRC_16(cadena : string):word; var valuehex : word; i: integer; CRC : word; Begin CRC := 0; for i := 1 to length(cadena) do begin valuehex :=...

sun.awt.image.PNGImageDecoder$PNGException: crc corruption

Hello I'm working in a big java project, with about 400 classes. Suddenly I got this error sun.awt.image.PNGImageDecoder$PNGException: crc corruption at sun.awt.image.PNGImageDecoder.getChunk(PNGImageDecoder.java:699) at sun.awt.image.PNGImageDecoder.getData(PNGImageDecoder.java:707) at sun.awt.image.PNGImageDecoder.produce...

Find the Algorithm that generates the checksum

I have a sensing device that transmits a 6-byte message along with an 1-byte counter and supposedly a checksum. The data looks something like this: ------DATA----------- -Counter- --Checksum?-- 55 FF 00 00 EC FF ---- 60---------- 1F The last four bits in the counter are always set 0, i.e those bits are probably not used. The last ...

"Zlib::GzipFile::CRCError crc error" when install gem packages.

[root@blanee local_cache]# gem install dm-core-0.9.11.gem ERROR: While executing gem ... (Zlib::GzipFile::CRCError) invalid compressed data -- crc error [root@blanee local_cache]# gem install ParseTree-3.0.5.gem ERROR: While executing gem ... (Zlib::GzipFile::CRCError) invalid compressed data -- crc error I have a lot gem p...

CRC error detection problem

Hi guys, I need to implement the CRC error detection in my system. I wonder how to determine the maximal number of detectable error (and undetectable as well) having the generation polynomial? Assume that I have got, say, the following g(x) = x^4 + x^3 + 1. There are 2^15 possible transmissions - the 11-bit words might be protected by...

Hamming distance and CRC.

Hi guys, How to find the Hamming distance of a code generated by a certain CRC? Assume that I have a generating polynomial of order, say, 4 and 11 bits of data. How to compute the HD basing only on these information? Cheers. ...

How to Determine Which CRC to Use?

If I have a certain number of bytes to transfer serially, how do I determine which CRC (CRC8, CRC16, etc., basically a how many bit CRC?) to use and still have error detection percentage be high? Is there a formula for this? ...

CRC-CCITT (XModem) implementation in javascript

Hi, i'm trying to implement a CRC-CCITT (XModem) check in javascript without success. I need it in order to send socket string into a controller via RS232. does anyone know how to do it? or perhaps is there a sample code somewhere?? I would appreciate any kind of help :) ...

CRC-16-ANSI library for for Java/Groovy?

I need to compute the CRC-16 for arbitrary strings in a mixed java/groovy application. Specifically, I need the CRC-16-ANSI aka CRC-16-IBM variant (see http://en.wikipedia.org/wiki/Cyclic_redundancy_check for details; this is the modbus / USB version.) I could implement my own, but I'd much rather find a library out there that someone ...

Fast CRC of a Drawing.Bitmap

On application startup I build a cache of icons (24x24 32bbp pre-multiplied argb bitmaps). this cache contains roughly a thousand items. I don't want to store the same image multiple times in this cache, for both memory and performance reasons. I figured the best way would be to create some sort of crc from each bitmap as it goes into th...

How do I copy data from a defective DVD to my hard disk using Perl?

The situation is this: My system (Win XP Pro) is unable to copy a huge video file (around 6 gigs) from a DVD disk, which might be defective, scratched or whatever but which can be played back with mplayer with a few frames full of mosaic though. When the copying process lasted for a certain length of time, the system would abort the effo...

How to calculate CRC checksum in Actionscript 3?

Hi, I am developing an application in flex in which I need to calculate checksum of different files. I would like to know if there is a direct method in actionscript to calculate that or do I have to go for any external libraries? Thanks in advance :) ...

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 System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CRC64...

Does anyone have CRC128 and CRC256 Code in C++ and C#?

I am learning, trying to get thoughts behind CRC. I can't find CRC128 and CRC256 code anywhere. If anyone of you have the C++ or C# Code for them, please share them with me. Also provide online links to the websites. I am a newbie and can't code it by myself at all, neither can convert theories and mathematics to the coding. So I ask for...

Best way to test CRC logic?

How can I verify two CRC implementations will generate the same checksums? I'm looking for an exhaustive implementation evaluating methodology specific to CRC. ...

Trouble calculating with CRC (computer math)

Hi So I have a CRC polynomial x3 + x1 + 1 on a letter 'P' I need to divide the binary code of 'P' by the polynomial But I'm stuck at this point.. 0 1 0 1 0 0 0 0 000 | 1 0 1 1 1 0 1 1 | --------- | 1 1 1 0 0 ? 1 0 1 1 I don't understand what to do with the 1 in front? Does someone know an answer here? ...

How to get file crc/checksum in asp.net

Given a file on the local filesystem: FileInfo file = new FileInfo(localFilename); How can I get a CRC-value (or some kind of checksum) for that file? ...