Gathering detailed insights and metrics for extra-bit
Gathering detailed insights and metrics for extra-bit
Gathering detailed insights and metrics for extra-bit
Gathering detailed insights and metrics for extra-bit
extra-integer
A 32-bit integer can store values from -2^31 to 2^31 - 1.
extra-bit.web
The bit is a basic unit of information in information theory, computing {web}.
extra-integer.web
A 32-bit integer can store values from -2^31 to 2^31 - 1 {web}.
extra-bit.min
The bit is a basic unit of information in information theory, computing.
The bit is a basic unit of information in information theory, computing.
npm install extra-bit
Typescript
Module System
Node Version
NPM Version
TypeScript (64.02%)
JavaScript (35.98%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
101 Commits
1 Forks
2 Watchers
2 Branches
1 Contributors
Updated on Apr 08, 2025
Latest Version
2.3.1
Package Id
extra-bit@2.3.1
Unpacked Size
15.64 kB
Size
4.42 kB
File Count
6
NPM Version
10.9.2
Node Version
22.14.0
Published on
Apr 08, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
The bit is a basic unit of information in information theory, computing.
📦 Node.js,
🌐 Web,
📜 Files,
📰 Docs,
📘 Wiki.
The concept of a bit, which stands for binary digit, has been a
fundamental unit of information in the fields of information theory and
computing. Bitwise operations are used to manipulate and process data at the bit
level, and these operations are crucial for efficient programming in a variety
of domains, such as computer graphics and cryptography. JavaScript converts a
Number
(a 64-bit floating point number) to a 32-bit integer when bitwise
operators (such as |
) are applied. All bitwise operations are performed on
32-bit integers. This package includes bit twiddling hacks by Sean Eron
Anderson and many others.
This package is available in Node.js and Web formats. To use it on the web,
simply use the extra_bit
global variable after loading with a <script>
tag from the jsDelivr CDN.
Stability: Experimental.
1const xbit = require('extra-bit'); 2// import * as xbit from "extra-bit"; 3// import * as xbit from "https://unpkg.com/extra-bit/index.mjs"; (deno) 4 5xbit.count(7); 6// → 3 (111 ⇒ 3) 7 8xbit.parity(8, 2); 9// → 2 (10,00 ⇒ 10) 10 11xbit.swap(6, 1, 0); 12// → 5 (110 ⇒ 101) 13 14xbit.reverse(0xFFFF0000); 15// → 65535 (0x0000FFFF) 16 17xbit.signExtend(15, 4); 18// → -1
Property | Description |
---|---|
get | Get bits at specified index. |
getAs | Get bits as per mask. |
set | Set bits at specified index. |
setAs | Set bits as per mask. |
toggle | Toggle bits at specified index. |
toggleAs | Toggle bits as per mask. |
swap | Swap bit sequences at specified indices. |
scan | Find index of first set bit from LSB. |
scanReverse | Find index of first set bit from MSB. |
count | Count bits set. |
parity | Calculate n-bit parity. |
rotate | Rotate bits by a certain amount. |
reverse | Reverse all bits. |
merge | Merge bits as per mask. |
interleave | Interleave bits of two int16s. |
signExtend | Sign extend variable bit-width integer. |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
6 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More