0.1.2 • Published 7 years ago

integer-bitswap v0.1.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

integer-bitswap

NOTE: integer-bitswap was renamed to @extra-integer/bit-swap. NPM

Swap bit sequences in 32-bit integer (xor method).

const bitSwap = require('integer-bitswap');
// bitSwap(<integer>, <position-1>, <position-2>, [bits=1])

bitSwap(6, 1, 0);
// 5 (110 => 101)
bitSwap(0x1234, 8, 4, 4);
// 4900 (0x1234 => 0x1324)
bitSwap(0x4AAB, 8, 0, 8);
// 43850 (0x4AAB => 0xAB4A)
0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago