From 545932ab47b096a11573d2223beb591acc02de6d Mon Sep 17 00:00:00 2001 From: boddmg Date: Fri, 10 Oct 2014 16:06:22 +0800 Subject: [PATCH] Update crc16pure.py Fix the init crc value of the crc16xmodem to suit the request --- python2x/crc16/crc16pure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python2x/crc16/crc16pure.py b/python2x/crc16/crc16pure.py index 9319de4..7d936da 100644 --- a/python2x/crc16/crc16pure.py +++ b/python2x/crc16/crc16pure.py @@ -81,7 +81,7 @@ def _crc16(data, crc, table): return crc & 0xffff -def crc16xmodem(data, crc=0): +def crc16xmodem(data, crc=0xffff): """Calculate CRC-CCITT (XModem) variant of CRC16. `data` - data for calculating CRC, must be a string `crc` - initial value