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
@classmethod
def get(cls, data: bytes, **kwargs) -> _T: (source)

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

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

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

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