def rotatebits(bits: int) -> int:
    """Rotates the bits in a byte

    Args:
        bits: the int 8 bits to rotate

    Returns:
        int value of rotated 8 bits
    """
    return sum(
        ((bits & (1 << bit)) >> bit) << (7 - bit) for bit in range(7, 0, -1)
    )