Rotate bits by a certain amount.
Similar: rotate, reverse.
rotate(x, [n]) // x: an int32 // n: rotate amount (+ve: left, -ve: right)
const xbit = require('extra-bit'); xbit.rotate(0x11112222, 4); // → 286401057 (0x11122221) xbit.rotate(0x11112222, -4); // → 554766882 (0x21111222)
There was an error while loading. Please reload this page.