rotateLeft method

int rotateLeft(
  1. int n,
  2. int count
)

Left rotation of a 32-bit value by count places.

Implementation

int rotateLeft(int n, int count) {
  assert(count >= 0 && count < 32);
  n &= 0xFFFFFFFF;
  return ((n << count) | (n >> (32 - count))) & 0xFFFFFFFF;
}