diceware-en 0.1.1 → 1.0.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.
- package/LICENSE +8 -8
- package/README.md +59 -64
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -1
package/LICENSE
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Copyright 2025, Cícero Mello <https://github.com/cicero-mello> and Contributors
|
|
2
|
-
(original code, collection of the 7,776 words and review by Cícero Mello)
|
|
3
|
-
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
-
|
|
6
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Copyright 2025, Cícero Mello <https://github.com/cicero-mello> and Contributors
|
|
2
|
+
(original code, collection of the 7,776 words and review by Cícero Mello)
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,64 +1,59 @@
|
|
|
1
|
-
# diceware-en
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
| Name | Description
|
|
41
|
-
|
|
42
|
-
| `
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## Tips
|
|
61
|
-
- Warn your user that sentences with negative interpretations may arise due to the randomness of words (even with a set of words avoiding huge offenses, the random combination of words can generate a sentence that can be interpreted in a pejorative way about something)
|
|
62
|
-
|
|
63
|
-
<!-- ## Speaks portuguese? Fell free to improve the list! 😊
|
|
64
|
-
You can find more information about how to do that [here](https://gist.github.com/cicero-mello/1ad2669a5edf7584b3d8057b3108bd45). -->
|
|
1
|
+
# diceware-en
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/diceware-en)
|
|
4
|
+
[](https://bundlephobia.com/package/diceware-en)
|
|
5
|
+
|
|
6
|
+
<img alt="demo" src="https://raw.githubusercontent.com/cicero-mello/diceware-en/refs/heads/main/demo.gif" style="max-height: 240px;"/>
|
|
7
|
+
|
|
8
|
+
English diceware list with useful functions.
|
|
9
|
+
*Free, typed and easy to use.*
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
### General Usage Example:
|
|
15
|
+
```typescript
|
|
16
|
+
import { dicewareEN } from "diceware-en"
|
|
17
|
+
|
|
18
|
+
console.log(
|
|
19
|
+
dicewareEN.generatePhrase(4)
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Properties from ``dicewareEN`` object:
|
|
24
|
+
|
|
25
|
+
| Property | Description | Example |
|
|
26
|
+
|-------------------|-------------------------------------------------------|---------------------------------------------------|
|
|
27
|
+
| `words` | Array with all 7776 words from the diceware list | ``dicewareEN.words`` |
|
|
28
|
+
| `generatePhrase` | Generates a random passphrase based on words quantity | ``dicewareEN.generatePhrase(8)`` |
|
|
29
|
+
| `generateKey` | Generates a random Diceware Key | ``dicewareEN.generateKey()`` |
|
|
30
|
+
| `keyToIndex` | Converts a Diceware Key into a word list index | ``dicewareEN.keyToIndex("11111")`` |
|
|
31
|
+
| `getWord` | Get the corresponding word based on a Diceware Key | ``dicewareEN.getWord("11111")`` |
|
|
32
|
+
|
|
33
|
+
### Types:
|
|
34
|
+
|
|
35
|
+
| Name | Description | Example |
|
|
36
|
+
|-------------------|-------------------------------------------------------|-------------------------------------------|
|
|
37
|
+
| `DicewareKey` | String with 5 number characters from "1" to "6" | ``"11111"``, ``"66666"``, ``"12346"``... |
|
|
38
|
+
|
|
39
|
+
### Others:
|
|
40
|
+
| Name | Description | Example |
|
|
41
|
+
|-------------------|---------------------------------------------------------------------------------------------------|-----------------------|
|
|
42
|
+
| `getRandomInt` | Generates a random int number from 0 to an max inclusive value using `crypto.getRandomValues()` | `getRandomInt(10)` |
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Notes
|
|
49
|
+
- All words have between 4 and 7 letters.
|
|
50
|
+
- Problematic words have been avoided.
|
|
51
|
+
<!-- - Excessive variations of the same word (such as verb conjugation) have been avoided. -->
|
|
52
|
+
- Extremely little-known words have been avoided.
|
|
53
|
+
- You can manually check all current used words [here](https://github.com/cicero-mello/diceware-en/blob/main/words.txt).
|
|
54
|
+
|
|
55
|
+
## Tips
|
|
56
|
+
- Warn your user that sentences with negative interpretations may arise due to the randomness of words (even with a set of words avoiding huge offenses, the random combination of words can generate a sentence that can be interpreted in a pejorative way about something)
|
|
57
|
+
|
|
58
|
+
<!-- ## Speaks english? Fell free to improve the list! 😊
|
|
59
|
+
You can find more information about how to do that [here](https://gist.github.com/cicero-mello/1ad2669a5edf7584b3d8057b3108bd45). -->
|