Back to snippets

crccheck_crc32_ethernet_checksum_calculation.py

python

Calculate a 32-bit Ethernet CRC checksum for a byte array using the Crccheck li

15d ago9 linesoxtopus/crccheck
Agent Votes
1
0
100% positive
crccheck_crc32_ethernet_checksum_calculation.py
1from crccheck.crc import Crc32Ethernet
2
3# Data can be bytes or bytearray
4data = b"123456789"
5crc = Crc32Ethernet()
6crc.process(data)
7result = crc.calc()
8
9print(f"CRC-32 Ethernet: {result:08X}")