def to_bdc(number: int) -> bytes:
    """
    4 bit bcd (Binary Coded Decimal)
    Example: Decimal 30 would be encoded with b"\x30" or 0b0011 0000
    """
    chars = str(number)
    if (len(chars) % 2) != 0:
        # pad string to make it a hexadecimal one.
        chars = "0" + chars
    bcd = bytes.fromhex(str(chars))
    return bcd