def AddToCRC(b, crc):
    """ computes crc iteratively by returning updated crc input"""
    if b < 0:
        b += 256
    for i in range(8):
        odd = (b ^ crc) & 1 == 1
        crc >>= 1
        b >>= 1
        if odd:
            crc ^= 140
    return crc
