From 24dc5fb405abe4c5542ef7c746361bc77eb30c4d Mon Sep 17 00:00:00 2001 From: Thomas Pircher Date: Sun, 5 Apr 2009 00:00:00 +0100 Subject: [PATCH] 2009-03-26 * crc_models.py: added crc-32mpeg. Thanks to Thomas Edwards. --- ChangeLog | 8 ++++++++ crc_models.py | 11 +++++++++++ crc_opt.py | 2 +- doc/pycrc.xml | 5 +++-- test/test.sh | 12 +++++++++++- 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0755ada..fe0a6d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +# +# Version 0.7.1, 2009-04-05 +# + +2009-03-26 Thomas Pircher + + * crc_models.py: added crc-32mpeg. Thanks to Thomas Edwards. + # # Version 0.7, 2009-02-27 # diff --git a/crc_models.py b/crc_models.py index 2bbe715..da85269 100644 --- a/crc_models.py +++ b/crc_models.py @@ -223,6 +223,17 @@ class CrcModels(object): 'direct': True, 'check': 0xe3069283, }) + models.append({ + 'name': 'crc-32mpeg', + 'width': 32, + 'poly': 0x4c11db7, + 'reflect_in': False, + 'xor_in': 0xffffffff, + 'reflect_out': False, + 'xor_out': 0x0, + 'direct': False, + 'check': 0x0376e6e7, + }) models.append({ 'name': 'posix', 'width': 32, diff --git a/crc_opt.py b/crc_opt.py index 13f4fa6..fd47422 100644 --- a/crc_opt.py +++ b/crc_opt.py @@ -53,7 +53,7 @@ class Options(object): Program details """ ProgramName = "pycrc" - Version = "0.7" + Version = "0.7.1" VersionStr = "%s v%s" % (ProgramName, Version) WebAddress = "http://www.tty1.net/pycrc/" diff --git a/doc/pycrc.xml b/doc/pycrc.xml index 36f0d81..488f8f8 100644 --- a/doc/pycrc.xml +++ b/doc/pycrc.xml @@ -2,12 +2,12 @@ - + - + @@ -223,6 +223,7 @@ crc-24, crc-32, crc-32c, + crc-32mpeg, posix, jam, xfer, diff --git a/test/test.sh b/test/test.sh index c842bf8..3904fce 100755 --- a/test/test.sh +++ b/test/test.sh @@ -307,7 +307,17 @@ testbin "$opt" "$res" #JAMCRC res="0x340bc6d9" cmd="$PYCRC --model jam" -opt="--width 32 --poly 0x04c11db7 --reflect-in 1 --xor-in 0xffffffff --reflect-out 1 --xor-out 0x0" +opt="--width 32 --poly 0x4c11db7 --reflect-in 1 --xor-in 0xffffffff --reflect-out 1 --xor-out 0x0" +teststr "$cmd" "$res" +teststr "$PYCRC $opt --direct 0" "$res" +teststr "$PYCRC $opt --direct 1" "$res" +testfil "$cmd" "$res" +testbin "$opt" "$res" + +#CRC-32MPEG +res="0x376e6e7" +cmd="$PYCRC --model crc-32mpeg" +opt="--width 32 --poly 0x4c11db7 --reflect-in 0 --xor-in 0xffffffff --reflect-out 0 --xor-out 0x0" teststr "$cmd" "$res" teststr "$PYCRC $opt --direct 0" "$res" teststr "$PYCRC $opt --direct 1" "$res"