Bitwise rotate a 32-bit number to the left. - Node.js Number

Node.js examples for Number:Hex

Description

Bitwise rotate a 32-bit number to the left.

Demo Code

function rol(num, cnt) {
  return (num << cnt) | (num >>> (32 - cnt));
}

Related Tutorials