rotr32 function

int rotr32(
  1. int val,
  2. int shift
)

Rotates a 32-bit integer right by a specified number of bits.

Implementation

int rotr32(int val, int shift) {
  var modShift = shift & 31;
  return ((val >> modShift) & mask32) | ((val & mask32) << (32 - modShift));
}