def c_uchar(i):
    """
    Convert arbitrary integer to c unsigned char type range as if casted in c.

    >>> c_uchar(0x12345678)
    120
    >>> (c_uchar(-123), c_uchar(-1), c_uchar(255), c_uchar(256))
    (133, 255, 255, 0)
    """
    return i & 0xFF