[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

*Subject*: **Re: [xliff] How to refer to the proper CRC32 algorithm for the track changes module?**

*From*:**Helena S Chapman <hchapman@us.ibm.com>***To*: "Schurig, Joachim" <Joachim.Schurig@lionbridge.com>*Date*: Mon, 1 Apr 2013 15:30:06 -0400

I prefer pointing to an external reference but what we can do is to include the pseudo code as a sample so people understand what the compliant behavior would look like.

From: "Schurig, Joachim" <Joachim.Schurig@lionbridge.com>

To: "xliff@lists.oasis-open.org" <xliff@lists.oasis-open.org>

Date: 03/19/2013 01:50 PM

Subject: [xliff] How to refer to the proper CRC32 algorithm for the track changes module?

Sent by: <xliff@lists.oasis-open.org>

Hi everyone,

as briefly discussed today in the call I wanted to hear your opinion how one can best refer to the CRC32 implementation I proposed to use in the Track Changes module which Ryan prepares.

The problem with CRCs is that there are many algorithms. For CRC32 there are still 3 used ones, using different polynomials, so one needs to refer to the right one, and then it needs to be clarified which init and exit operations are done on the calculated CRC value, because that is not determined by the polynomial.

Just so everyone understands: the bulk of CRC32 implementations (in ZIP, Ethernet, ..) use the same algorithm and values – but there are more. And if you look e.g. at the English Wikipedia page about CRCs (

The initial idea was to point to an existing standard. But that is difficult, because commonly people use a reference to RFC 1952 (

So the idea was to come up with pseudo code to make sure the right algorithm and init and exit values are understood.

Is this anything you would deem suitable for a standards document like the XLIFF draft? Or should we only refer to the mathematical foundations, by pointing to ITU-T V.42 (

My proposed pseudo code looks like this:

Pseudo code to generate the CRC32 bit-by-bit looks as follows (where it is assumed that the least significant bit is the rightmost):

crc = 0xFFFFFFFF

crc = right shift(crc) XOR 0xEDB88320

crc = right shift(crc)

crc = crc XOR 0xFFFFFFFF

Pseudo code to generate the CRC32 in the typical table driven approach looks as follows:

Table generation:

crc = n

crc = right shift(crc) XOR 0xEDB88320

crc = right shift(crc)

CRC_TABLE[n] = crc

CRC calculation:

crc = 0xFFFFFFFF

crc = CRC_TABLE[ (crc XOR input[n]) AND 0xFF ] XOR right shift(crc, 8)

crc = crc XOR 0xFFFFFFFF

0xEDB88320 is the reverse order representation of the coefficients of the polynomial x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1

Thanks for any comments!

(and I hope the code survives the list re-send halfways formatted)

Joachim

________________________________

Joachim Schurig

Senior Technical Director,

Lionbridge Fellow

Lionbridge

1240 Route des Dolines

06560 Sophia Antipolis

France

**Follow-Ups**:**Re: [xliff] How to refer to the proper CRC32 algorithm for the track changes module?***From:*"Dr. David Filip" <David.Filip@ul.ie>

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]