def prevcrc32(invtab, crctab, nxt, byte):
    """
    return value such that  crc32(prev, byte) == nxt

    next = crctab[(prev^byte)&0xff] ^ (prev>>8)
    """
    i = invtab[nxt>>24]              # i == (prev^byte)&0xff
    return (( (crctab[i] ^ nxt)<<8 ) | (i^byte)) & 0xFFFFFFFF