def rotl(n, rotations=1, w=32):
    """ binary rotation (left)

        Args:
            n -- int -- number to rotate,
            rotations -- int -- number of rotations
            w -- int -- max size in bits for n

        return n rotated
    """
    return (n << rotations%w) & (2**w-1) | ((n & (2**w-1)) >> (w-(rotations%w)))