By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,190 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,190 IT Pros & Developers. It's quick & easy.

Non-math-geek needs help with CRCs (binascii.crc32)

P: n/a
1) Does anyone know if the CRC32 algorithm in binascii has a name? There
seem to be a TON of different CRC32 methods; different polynomials,
different byte orders, different seeds, some flip the bits and some XOR the
result with something else.

I've been looking around and a lot of documents (RFCs, etc) refer to ISO3309
and/or ITU-T V.42 (neither of which appear to be available without paid
access), yet are often incompatible with each other. So unless they're
lying, I assume ISO3309 allows for the above variations, and specifying an
ISO3309 CRC32 doesn't narrow it down any.

2) With Python 2.4 and its signed hex(), what's the 'best'/shortest
(preferably one operation, without any if x < 0 business) way to get an
unsigned 32bit CRC?
Thanks all.

Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
nobody <ge*@bent.com> wrote:
1) Does anyone know if the CRC32 algorithm in binascii has a name? There
seem to be a TON of different CRC32 methods; different polynomials,
different byte orders, different seeds, some flip the bits and some XOR the
result with something else.

I've been looking around and a lot of documents (RFCs, etc) refer to ISO3309
and/or ITU-T V.42 (neither of which appear to be available without paid
access), yet are often incompatible with each other. So unless they're
lying, I assume ISO3309 allows for the above variations, and specifying an
ISO3309 CRC32 doesn't narrow it down any.


Look here

http://www.ross.net/crc/

and in particular here

http://www.repairfaq.org/filipg/LINK/F_crc_v3.html

For Ross N. Williams's thoughts on CRCs. Well worth reading IMHO.
You'll find interesting the section on the different way each CRC can
be used (reversed, reflected etc).

If you have a sample of data, its usually pretty easy to work out
which CRC it does actually use by trial and error. You can use the
code Ross provides to help.

--
Nick Craig-Wood
nc*@axis.demon.co.uk
Jul 18 '05 #2

P: n/a
Nick Craig-Wood wrote:
nobody <ge*@bent.com> wrote:
1) Does anyone know if the CRC32 algorithm in binascii has a name? There
seem to be a TON of different CRC32 methods; different polynomials,
If you have a sample of data, its usually pretty easy to work out
which CRC it does actually use by trial and error. You can use the
code Ross provides to help.


Probably _much_ easier just to check the source. (It's not
in Python, though, it's in the C source this time...)
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.