
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
@chainsafe/bit-utils
Advanced tools
Bitlist/Bitvector Utilities
npm install @chainsafe/bit-utils
import {BitList} from "@chainsafe/bit-utils";
// A BitList is created from a Uint8Array bitfield and a length of bits
const list: BitList = BitList.fromBitfield(Buffer.from([3]), 3);
// Or a BitList can be deserialized from a Uint8Array bitfield with a padding bit marking the length
const list2: BitList = BitList.deserialize(Buffer.from([11]));
// get length of bits
const _bitLength = list.bitLength;
// set bit
list.setBit(0, true);
// get bit
list.getBit(0) === true;
// serialize bitlist (without padding bit)
const output: Uint8Array = list.toBitfield();
// serialize bitlist (with padding bit)
const output2: Uint8Array = list.serialize();
import {BitVector} from "@chainsafe/bit-utils";
// A BitVector is created from a Uint8Array bitfield and a length of bits
const vector: BitVector = BitVector.fromBitfield(Buffer.from([3]), 3);
// get length of bits
const _bitLength = vector.bitLength;
// set bit
vector.setBit(0, true);
// get bit
vector.getBit(0) === true
// serialize bitvector (loses length information)
const output: Uint8Array = vector.toBitfield();
See our autogenerated API docs
Apache 2.0
FAQs
bitlist and bitvector utilities
The npm package @chainsafe/bit-utils receives a total of 113 weekly downloads. As such, @chainsafe/bit-utils popularity was classified as not popular.
We found that @chainsafe/bit-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.