
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@zekfad/bitbyte
Advanced tools
Flexible byte representation for JavaScript.
Install via npm:
npm install --save @zekfad/bitbyte
Install via yarn:
yarn add @zekfad/bitbyte
const BitByte = require('@zekfad/bitbyte');
const myByte = new BitByte(200);
console.log(myByte.toString()); // 11001000
console.log([...myByte]); // [ 1, 1, 0, 0, 1, 0, 0, 0 ]
console.log(myByte[1], myByte[2]); // 1 0
myByte[1] = 0;
myByte[2] = 1;
console.log(myByte.toString()); // 10101000
console.log(0 + myByte); // 168
const myByte = new BitByte(200);
console.log(myByte.toString()); // 11001000
const myByte = new BitByte([ 1, 1, 0, 0, 1, 0, 0, 0]);
console.log(myByte.toString()); // 11001000
You can also pass in Booleans:
const myByte = new BitByte([ true, true, false, false, true, false, false, false]);
console.log(myByte.toString()); // 11001000
const myByte = new BitByte(200);
console.log([...myByte]); // [ 1, 1, 0, 0, 1, 0, 0, 0 ]
const myByte = new BitByte(200);
// get
console.log(myByte[1], myByte[2]); // 1 0
// set
myByte[1] = 0;
myByte[2] = 1;
const myByte = new BitByte(200);
console.log(myByte == 200); // true
console.log(myByte + 0); // 200
console.log(new Number(myByte)); // [Number: 200]
const myByte = new BitByte(200);
console.log(new String(myByte)); // [String: '11001000']
console.log(myByte.toString()); // '11001000'
For those who want to use function calls.
assign(bits, offset)Assigns array of bits to an instance.
getBit(offset)Returns a bit from requested offset in range from 0 to 7.
setBit(offset, bit)Sets a bit on requested offset in range from 0 to 7.
bit must be Number (0 or 1) or Boolean.
getByte()Returns byte as an unsigned byte integer.
getChar()Returns character from a byte.
FAQs
Flexible Byte Structure for JavaScript.
We found that @zekfad/bitbyte demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.