Zebrafy
Submodules
zebrafy.zebrafy_image module
zebrafy.zebrafy_pdf module
zebrafy.zebrafy_zpl module
zebrafy.crc module
- class zebrafy.crc.CRC(data_bytes, poly=None)[source]
Bases:
objectUtility class to calculate CRC-16-CCITT algorithm across the received data bytes.
CRC-16-CCITT polynomial representation: x^{16} + x^{12} + x^5 + 1
- Parameters:
data_bytes (
bytes) – Bytes object for which to calculate CRCpoly (
int) – Reversed polynomial representation for CRC-16-CCITT calculation, defaults to0x8408
- property data_bytes
attrgetter(attr, …) –> attrgetter object
Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).
- get_crc_hex_string()[source]
Get CRC-16-CCITT as four digit zero padding hexadecimal string.
- Return type:
str- Returns:
CRC-16-CCITT as four digit zero padding hexadecimal string
- property poly
attrgetter(attr, …) –> attrgetter object
Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).