@extra-bit/rotate.min

Rotates bits. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Usage no npm install needed!

<script type="module">
  import extraBitRotateMin from 'https://cdn.skypack.dev/@extra-bit/rotate.min';
</script>

README

Rotates bits. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Similar: rotate, reverse.

This is part of package extra-bit.

This is browserified, minified version of @extra-bit/rotate.
It is exported as global variable bit_rotate.
CDN: unpkg, jsDelivr.


bit.rotate(x, [n]);
// x: an int32
// n: rotate amount (+ve: left, -ve: right)
const bit = require("extra-bit");

bit.rotate(0x11112222, 4);
// 286401057 (0x11122221)

bit.rotate(0x11112222, -4);
// 554766882 (0x21111222)


References