We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Get n-bit parity. 📦 😺 🏃 📼 🌔 📜 📰 📘
Similar: count, parity.
bit.parity(x, [n]); // x: an int32 // n: number of bits (1)
const bit = require("extra-bit"); bit.parity(7); // 1 (1,1,1 ⇒ 1) bit.parity(5); // 0 (1,0,1 ⇒ 0) bit.parity(8, 2); // 2 (10,00 ⇒ 10) bit.parity(63, 4); // 12 (11,1111 ⇒ 1100)