class documentation

Converter for 2-digit binary-coded decimal

A single byte contains two decimal digits as if they were hex digits.

Class Method get Converts bytes -> int from 2-digit binary coded decimal
Class Method set Converts int -> bytes as 2-digit binary coded decimal
def get(cls, data: bytes, **kwargs) -> int: (source)

Converts bytes -> int from 2-digit binary coded decimal

Parameters
data:bytesThe raw bytes to convert
**kwargsUndocumented
Returns
intThe number stored in data
def set(cls, value: int, *, length: int = None, **kwargs) -> bytes: (source)

Converts int -> bytes as 2-digit binary coded decimal

Parameters
value:intThe value to convert
length:intThe length of the data section
**kwargsUndocumented
Returns
bytesThe bytes representing value in BCD