diff --git a/src/teletext/models.py b/src/teletext/models.py index f5509b4..f896234 100644 --- a/src/teletext/models.py +++ b/src/teletext/models.py @@ -82,8 +82,9 @@ class Page: Row 0: Skips first 8 bytes (Header/Control). Uses bytes 8-39. Rows 1-23: Uses all 40 bytes. Data is 7-bit (stripped parity). + Initial value: 0 (ETSI EN 300 706 9.4.1.2). """ - crc = 0xFFFF + crc = 0 poly = 0x1021 # Helper to update CRC with a byte @@ -135,13 +136,13 @@ class Page: if designation == 0: # Packet 27/0 - # Checksum is in bytes 38 and 39 + # Checksum is in bytes 38 and 39. + # ETSI EN 300 706: 8 bits of each byte are used. if len(p.data) >= 40: hi = p.data[38] lo = p.data[39] - # Strip parity - crc = ((hi & 0x7F) << 8) | (lo & 0x7F) + crc = (hi << 8) | lo return crc except: pass