def calculate_16bit_parts(value):
    """Calculate the low and high part representations of value."""
    if not (0 <= value < 65535):
        value = min(max(value, 0), 65535)
    # high_byte = value // 256
    # low_byte = value % 256
    # return high_byte, low_byte
    # faster:
    # return value // 256, value % 256
    # faster again:
    return value >> 8, value & 255