@bigdreamsweb3/wordbin 1.0.5 → 1.0.6
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.
- package/README.md +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ console.log("Dictionary Version used (header byte):", encoded.dictVersion);
|
|
|
47
47
|
// → Dictionary Version used (header byte):: 2
|
|
48
48
|
|
|
49
49
|
console.log("Encoded bytes:", encoded.encodedBytes);
|
|
50
|
-
// →
|
|
50
|
+
// → Encoded bytes: 34
|
|
51
51
|
|
|
52
52
|
console.log("Original bytes:", encoded.originalBytes);
|
|
53
53
|
// → Original bytes: 70
|
|
@@ -90,21 +90,21 @@ npx wordbin build --custom ./my-local-words.txt
|
|
|
90
90
|
|
|
91
91
|
## Dictionary Versions
|
|
92
92
|
|
|
93
|
-
| Version | Filename | Words
|
|
94
|
-
| ------- | --------------------- |
|
|
95
|
-
| v1 | wordbin-v1-bip39.json | 2,048
|
|
96
|
-
| v2 | wordbin-v2-dwyl.json | ~
|
|
97
|
-
|
|
98
|
-
> **v2 note**: The dwyl list contains capitalized words. Encoding/decoding is case-sensitive. Normalize to lowercase for case-insensitive behavior.
|
|
93
|
+
| Version | Filename | Words | Source | ID bytes | Best for |
|
|
94
|
+
| ------- | --------------------- | -------- | ------------------ | -------- | --------------------------------------- |
|
|
95
|
+
| v1 | wordbin-v1-bip39.json | 2,048 | BIP-39 English | ~2 | Crypto recovery seeds, high reliability |
|
|
96
|
+
| v2 | wordbin-v2-dwyl.json | ~479,000 | dwyl/english-words | 2–4 | General English, tags, keywords |
|
|
99
97
|
|
|
100
98
|
---
|
|
101
99
|
|
|
102
100
|
## How It Works
|
|
103
101
|
|
|
104
|
-
1. Each word
|
|
105
|
-
2.
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
1. Each word is hashed → first **2–4 bytes** = its fixed ID.
|
|
103
|
+
2. If the ID is in the dictionary → use the short ID.
|
|
104
|
+
Otherwise → store the word as a compact literal block.
|
|
105
|
+
3. Payload begins with one byte: **dictionary version**.
|
|
106
|
+
4. Decoding uses the same dictionary to reverse IDs → original words.
|
|
107
|
+
5. Backtracking handles any ID length ambiguity → guaranteed correct output.
|
|
108
108
|
|
|
109
109
|
---
|
|
110
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigdreamsweb3/wordbin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "WordBin – Encode words & short text into tiny, reversible binary for storage, URLs, IoT, QR codes, metadata, blockchain, or Web3 apps.",
|
|
5
5
|
"author": "Agbaka Daniel Ugonna <99cratson@gmail.com>",
|
|
6
6
|
"license": "MIT",
|