def rot32(w, nLeft):
 nLeft &= 31
 if (nLeft == 0):
  return w
 RRR = (((w >> 1) & 2147483647) >> (31 - nLeft))
 sLLLLLL = ((- ((1 << (31 - nLeft)) & w)) | ((2147483647 >> nLeft) & w))
 return (RRR | (sLLLLLL << nLeft))

def rot32 ( w , nLeft ) : nLeft &= 31 if ( nLeft == 0 ) : return w RRR = ( ( ( w >> 1 ) & 2147483647 ) >> ( 31 - nLeft ) ) sLLLLLL = ( ( - ( ( 1 << ( 31 - nLeft ) ) & w ) ) | ( ( 2147483647 >> nLeft ) & w ) ) return ( RRR | ( sLLLLLL << nLeft ) )
rotate 32-bit word left by nleft or right by -nleft without creating a python long .