bit-byte-bit 0.0.0-stage → 2.1.1

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 (33) hide show
  1. package/README.md +24 -2
  2. package/assets/bg/blue.mp4 +0 -0
  3. package/assets/bg/green.mp4 +0 -0
  4. package/assets/bg/poster.jpg +0 -0
  5. package/assets/bg/teal.mp4 +0 -0
  6. package/assets/fonts/auge-bold.otf +0 -0
  7. package/assets/fonts/auge-regular.otf +0 -0
  8. package/assets/fonts/auge-semibold.otf +0 -0
  9. package/assets/fonts/inter-var.ttf +0 -0
  10. package/assets/fonts/jetbrains-mono-var.ttf +0 -0
  11. package/assets/fonts/pacifico.ttf +0 -0
  12. package/assets/fonts/space-grotesk-var.ttf +0 -0
  13. package/assets/logos/bit-byte-bit-backup.svg +48 -0
  14. package/assets/logos/bit-byte-bit.svg +19 -0
  15. package/assets/site/backup/Pacifico-Regular-95szj24p.ttf +0 -0
  16. package/assets/site/backup/auge-bold-vywa1g7b.otf +0 -0
  17. package/assets/site/backup/auge-regular-hz0spgka.otf +0 -0
  18. package/assets/site/backup/auge-semibold-td2xkdwf.otf +0 -0
  19. package/assets/site/backup/copium-meme.png +0 -0
  20. package/assets/site/backup/engine/controller.api.js +1344 -0
  21. package/assets/site/backup/engine/controller.inject.js +511 -0
  22. package/assets/site/backup/engine/controller.sw.js +418 -0
  23. package/assets/site/backup/engine/corridor.js +13215 -0
  24. package/assets/site/backup/engine/corridor.wasm +0 -0
  25. package/assets/site/backup/site-backup.css +1 -0
  26. package/assets/site/backup/site-backup.js +74 -0
  27. package/assets/site/backup/sw.js +224 -0
  28. package/assets/site/index.html +113 -0
  29. package/assets/site/site.css +226 -0
  30. package/assets/site/site.js +188 -0
  31. package/index.cjs +83 -0
  32. package/index.d.ts +14 -0
  33. package/package.json +29 -4
package/README.md CHANGED
@@ -1,3 +1,25 @@
1
- # Temporary Holding Version
1
+ # bit-byte-bit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Small, dependency-free utilities for bytes, bits, hex, and data sizes.
4
+
5
+ ```js
6
+ const { formatBytes, parseBytes, bytesToHex, crc32 } = require("bit-byte-bit");
7
+
8
+ formatBytes(1536); // "1.5 KB"
9
+ formatBytes(1536, { binary: true }); // "1.5 KiB"
10
+ parseBytes("2.5 MB"); // 2500000
11
+ parseBytes("1 GiB"); // 1073741824
12
+ bytesToHex(new Uint8Array([255, 0, 171])); // "ff00ab"
13
+ crc32(new TextEncoder().encode("hello")); // 907060870
14
+ ```
15
+
16
+ ## API
17
+
18
+ - `formatBytes(n, opts?)` / `formatBits(n, opts?)` — human sizes. opts: `decimals`, `binary` (KiB/MiB), `base`
19
+ - `parseBytes(str)` — `"1.5 MB"`, `"2 GiB"`, `"512 kb"` to a number
20
+ - `bytesToBits(n)` / `bitsToBytes(n)` — unit conversion
21
+ - `bytesToHex(buf)` / `hexToBytes(str)` — hex encode/decode
22
+ - `crc32(buf)` — CRC-32 checksum
23
+ - `randomBytes(len)` — crypto-random `Uint8Array`
24
+
25
+ Zero dependencies, works in Node and browsers.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,48 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" style="position:fixed;inset:0;background:#000">
2
+ <defs>
3
+ <linearGradient id="lb-g" x1="0" y1="0" x2="100" y2="100" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#fbbf24"/>
5
+ <stop offset="1" stop-color="#f97316"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="bit-byte-bit-mark" display="none">
9
+ <circle cx="50" cy="50" r="20" fill="url(#lb-g)"/>
10
+ <g stroke="url(#lb-g)" stroke-width="6" stroke-linecap="round">
11
+ <line x1="50" y1="8" x2="50" y2="22"/><line x1="50" y1="78" x2="50" y2="92"/>
12
+ <line x1="8" y1="50" x2="22" y2="50"/><line x1="78" y1="50" x2="92" y2="50"/>
13
+ <line x1="20.4" y1="20.4" x2="30.1" y2="30.1"/><line x1="69.9" y1="69.9" x2="79.6" y2="79.6"/>
14
+ <line x1="79.6" y1="20.4" x2="69.9" y2="30.1"/><line x1="30.1" y1="69.9" x2="20.4" y2="79.6"/>
15
+ </g>
16
+ </g>
17
+ <foreignObject x="0" y="0" width="100%" height="100%">
18
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
19
+ <head>
20
+ <base href="../site/backup/" />
21
+ <meta charset="UTF-8" />
22
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
23
+ <title>bit-byte-bit</title>
24
+ <meta name="description" content="bit-byte-bit asset bundle — backup revision." />
25
+ <link rel="stylesheet" href="site-backup.css" />
26
+ <link rel="icon" href="copium-meme.png" />
27
+ <style>html,body,#root{margin:0;width:100%;height:100%;overflow:hidden}</style>
28
+ <script><![CDATA[
29
+ (function () {
30
+ const XHTML_NS = 'http://www.w3.org/1999/xhtml';
31
+ const root = document.querySelector('foreignObject').firstElementChild;
32
+ const createElementNS = document.createElementNS.bind(document);
33
+ Object.defineProperty(document, 'head', { get: () => root.querySelector('head'), configurable: true });
34
+ Object.defineProperty(document, 'body', { get: () => root.querySelector('body'), configurable: true });
35
+ Object.defineProperty(document, 'documentElement', { get: () => root, configurable: true });
36
+ document.createElement = function (tagName, options) {
37
+ return createElementNS(XHTML_NS, tagName, options);
38
+ };
39
+ })();
40
+ ]]></script>
41
+ </head>
42
+ <body>
43
+ <div id="root"></div>
44
+ <script src="site-backup.js"></script>
45
+ </body>
46
+ </html>
47
+ </foreignObject>
48
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
2
+ <defs>
3
+ <linearGradient id="bit-byte-bit-g" x1="0" y1="0" x2="64" y2="64" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#fbbf24"/>
5
+ <stop offset="1" stop-color="#f97316"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <circle cx="32" cy="32" r="13" fill="url(#bit-byte-bit-g)"/>
9
+ <g stroke="url(#bit-byte-bit-g)" stroke-width="4" stroke-linecap="round">
10
+ <line x1="32" y1="6" x2="32" y2="14"/>
11
+ <line x1="32" y1="50" x2="32" y2="58"/>
12
+ <line x1="6" y1="32" x2="14" y2="32"/>
13
+ <line x1="50" y1="32" x2="58" y2="32"/>
14
+ <line x1="13.6" y1="13.6" x2="19.4" y2="19.4"/>
15
+ <line x1="44.6" y1="44.6" x2="50.4" y2="50.4"/>
16
+ <line x1="50.4" y1="13.6" x2="44.6" y2="19.4"/>
17
+ <line x1="19.4" y1="44.6" x2="13.6" y2="50.4"/>
18
+ </g>
19
+ </svg>