extra-bit 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +47 -36
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,20 +1,23 @@
1
1
  The [bit] is a basic unit of information in information theory, computing.
2
2
  This package includes [bit twiddling hacks] by Sean Eron Anderson and many others.<br>
3
- :package: [NPM](https://www.npmjs.com/package/extra-bit),
4
- :smiley_cat: [GitHub](https://github.com/orgs/nodef/packages?repo_name=extra-bit),
5
- :running: [RunKit](https://npm.runkit.com/extra-bit),
6
- :vhs: [Asciinema](https://asciinema.org/a/337114),
7
- :moon: [Minified](https://www.npmjs.com/package/extra-bit.min),
8
- :scroll: [Files](https://unpkg.com/extra-bit/),
9
- :newspaper: [JSDoc](https://nodef.github.io/extra-bit/),
10
- :blue_book: [Wiki](https://github.com/nodef/extra-bit/wiki/).
3
+ 📦 [Node.js](https://www.npmjs.com/package/extra-bit),
4
+ 🌐 [Web](https://www.npmjs.com/package/extra-bit.web),
5
+ 📜 [Files](https://unpkg.com/extra-bit/),
6
+ 📰 [Docs](https://nodef.github.io/extra-bit/).
7
+ 📘 [Wiki](https://github.com/nodef/extra-bit/wiki/).
11
8
 
12
- > Stability: Experimental.
9
+ This package is available in *Node.js* and *Web* formats. The web format
10
+ is exposed as `extra_bit` standalone variable and can be loaded from
11
+ [jsDelivr CDN].
12
+
13
+ > Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
14
+
15
+ [jsDelivr CDN]: https://cdn.jsdelivr.net/npm/extra-bit.web/index.js
13
16
 
14
17
  <br>
15
18
 
16
19
  ```javascript
17
- const bit = require("extra-bit");
20
+ const bit = require('extra-bit');
18
21
  // import * as bit from "extra-bit";
19
22
  // import * as bit from "https://unpkg.com/extra-bit@1.0.50/index.mjs"; (deno)
20
23
 
@@ -40,20 +43,24 @@ bit.signExtend(15, 4);
40
43
 
41
44
  ## Index
42
45
 
43
- | Method | Action |
44
- | ------------ | ---------------------------------------- |
45
- | [get] | Gets a bit. |
46
- | [set] | Sets a bit. |
47
- | [toggle] | Toggles a bit. |
48
- | [swap] | Swaps bit sequences. |
49
- | [scan] | Finds index of first set bit from LSB. |
50
- | [count] | Counts bits set. |
51
- | [parity] | Finds n-bit parity. |
52
- | [rotate] | Rotates bits. |
53
- | [reverse] | Reverses all bits. |
54
- | [merge] | Merges bits as per mask. |
55
- | [interleave] | Interleaves bits of two int16s. |
56
- | [signExtend] | Sign extends variable bit-width integer. |
46
+ | Property | Description |
47
+ | ---- | ---- |
48
+ | [get] | Get a bit. |
49
+ | [getAs] | Get bits as per mask. |
50
+ | [set] | Set a bit. |
51
+ | [setAs] | Set bits as per mask. |
52
+ | [toggle] | Toggle a bit. |
53
+ | [toggleAs] | Toggle bits as per mask. |
54
+ | [swap] | Swap bit sequences. |
55
+ | [scan] | Find index of first set bit from LSB. |
56
+ | [scanReverse] | Find index of first set bit from MSB. |
57
+ | [count] | Count bits set. |
58
+ | [parity] | Find n-bit parity. |
59
+ | [rotate] | Rotate bits. |
60
+ | [reverse] | Reverse all bits. |
61
+ | [merge] | Merge bits as per mask. |
62
+ | [interleave] | Interleave bits of two int16s. |
63
+ | [signExtend] | Sign extend variable bit-width integer. |
57
64
 
58
65
  <br>
59
66
  <br>
@@ -62,15 +69,19 @@ bit.signExtend(15, 4);
62
69
 
63
70
  [bit]: https://en.wikipedia.org/wiki/Bit
64
71
  [bit twiddling hacks]: https://graphics.stanford.edu/~seander/bithacks.html
65
- [get]: https://github.com/nodef/extra-bit/wiki/get
66
- [set]: https://github.com/nodef/extra-bit/wiki/set
67
- [swap]: https://github.com/nodef/extra-bit/wiki/swap
68
- [scan]: https://github.com/nodef/extra-bit/wiki/scan
69
- [count]: https://github.com/nodef/extra-bit/wiki/count
70
- [parity]: https://github.com/nodef/extra-bit/wiki/parity
71
- [reverse]: https://github.com/nodef/extra-bit/wiki/reverse
72
- [merge]: https://github.com/nodef/extra-bit/wiki/merge
73
- [interleave]: https://github.com/nodef/extra-bit/wiki/interleave
74
- [signExtend]: https://github.com/nodef/extra-bit/wiki/signExtend
75
- [toggle]: https://github.com/nodef/extra-bit/wiki/toggle
76
- [rotate]: https://github.com/nodef/extra-bit/wiki/rotate
72
+ [get]: https://nodef.github.io/extra-bit/modules.html#get
73
+ [getAs]: https://nodef.github.io/extra-bit/modules.html#getAs
74
+ [set]: https://nodef.github.io/extra-bit/modules.html#set
75
+ [setAs]: https://nodef.github.io/extra-bit/modules.html#setAs
76
+ [toggle]: https://nodef.github.io/extra-bit/modules.html#toggle
77
+ [toggleAs]: https://nodef.github.io/extra-bit/modules.html#toggleAs
78
+ [swap]: https://nodef.github.io/extra-bit/modules.html#swap
79
+ [scan]: https://nodef.github.io/extra-bit/modules.html#scan
80
+ [scanReverse]: https://nodef.github.io/extra-bit/modules.html#scanReverse
81
+ [count]: https://nodef.github.io/extra-bit/modules.html#count
82
+ [parity]: https://nodef.github.io/extra-bit/modules.html#parity
83
+ [rotate]: https://nodef.github.io/extra-bit/modules.html#rotate
84
+ [reverse]: https://nodef.github.io/extra-bit/modules.html#reverse
85
+ [merge]: https://nodef.github.io/extra-bit/modules.html#merge
86
+ [interleave]: https://nodef.github.io/extra-bit/modules.html#interleave
87
+ [signExtend]: https://nodef.github.io/extra-bit/modules.html#signExtend
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extra-bit",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "The bit is a basic unit of information in information theory, computing.",
5
5
  "sideEffects": false,
6
6
  "main": "index.js",