extra-bit
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.9%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: BitSculpter
- License: mit
- Language: TypeScript
- Default Branch: main
- Size: 323 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
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.
```javascript const xbit = require('extra-bit'); // import * as xbit from "extra-bit"; // import * as xbit from "https://unpkg.com/extra-bit/index.mjs"; (deno)
xbit.count(7); // 3 (111 3)
xbit.parity(8, 2); // 2 (10,00 10)
xbit.swap(6, 1, 0); // 5 (110 101)
xbit.reverse(0xFFFF0000); // 65535 (0x0000FFFF)
xbit.signExtend(15, 4); // -1 ```
Index
| 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. |
References
Owner
- Login: BitSculpter
- Kind: user
- Repositories: 18
- Profile: https://github.com/BitSculpter
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Sahu
given-names: Subhajit
orcid: https://orcid.org/0000-0001-5140-6578
title: "nodef/extra-bit: A collection of common bitwise operations"
version: 2.1.0
doi: 10.5281/zenodo.6791857
date-released: 2022-07-03
GitHub Events
Total
Last Year
Dependencies
- actions/checkout v4 composite
- actions/setup-node v3 composite
- coverallsapp/github-action master composite
- nodef/git-config.action v1.0.0 composite
- nodef/npm-config.action v1.0.0 composite
- paambaati/codeclimate-action v3.0.0 composite
- actions/checkout v4 composite
- actions/setup-node v3 composite
- 357 dependencies
- @rollup/plugin-commonjs ^25.0.7 development
- @rollup/plugin-node-resolve ^15.2.3 development
- @types/jest ^29.5.6 development
- extra-build ^2.2.43 development
- jest ^29.7.0 development
- rollup-plugin-cleanup ^3.2.1 development
- rollup-plugin-dts ^6.1.0 development
- ts-jest ^29.1.1 development
