Skip to content

Commit

Permalink
📝 diceware lists
Browse files Browse the repository at this point in the history
  • Loading branch information
weakish committed Aug 5, 2022
1 parent 9d07484 commit 03c317c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Installation

To compile from source, you need to have `go` installed.
To compile from the source, you need to have golang installed on the system.

git clone https://github.com/weakish/xkcd936
cd xkcd936
Expand Down Expand Up @@ -42,6 +42,17 @@ By default, xkcd936 will generate four words,
consistent with the [xkcd936] comic.
But xkcd936 can generate up to 12 words with the number specified in `-n`.

By default, the BIP32 English word list is used.
To use a BIP32 word list in another language, specify it in `-l`.

Some diceware-derived lists can also be used:

- `diceware{1,2,3,4}`: four lists split from [diceware8k], containing 2048 words each.
- `diceware2k`: [a wordlist derived from diceware8k][diceware2k], containing 2048 short words.

[diceware8k]: https://theworld.com/~reinhold/diceware8k.txt
[diceware2k]: https://diceware2k.surge.sh

### As a Library

```go
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func main() {
var titlized *bool = flag.Bool("t", false, "titlized words (English only)")
var version *bool = flag.Bool("V", false, "show version")
var number *int = flag.Int("n", 4, "number of words, 1 <= n <= 12")
var list *string = flag.String("l", "en", "word list: chs, cht, cs, en, fr, it, jp, ko, es")
var list *string = flag.String("l", "en", "word list: chs, cht, cs, en, fr, it, jp, ko, es, diceware{1,2,3,4} (split from diceware8k), diceware2k")
flag.Parse()

if *version {
Expand Down
2 changes: 1 addition & 1 deletion morelists/diceware-short.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var DicewareShort = strings.Split(strings.TrimSpace(diceware2k), "\n")
//
// cat diceware8k.txt | egrep '^.{2,3}$' | wc -l # 2028
//
// And diceware8k contains 51 single character "word": (seperated by comma):
// And diceware8k contains 51 single character "words": (seperated by comma):
//
// ; cat diceware8k.txt | egrep '^.$' | tr '\n' ','
// a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,
Expand Down

0 comments on commit 03c317c

Please sign in to comment.