update dependencies
remove unused zg module
refactor
Passphrase is a small, simple passphrase generator.
I was using Bitwarden's passphrase generator, which is good, except it only uses English words, and is also very slow. So I made this one. It's pretty fast and you can use any wordlist, or standard input. An English wordlist is included, and is the default.
Passphrase uses a reservoir sampling algorithm, so memory usage is proportional to the requested number of words, rather than the size of the wordlist.
The program is written in Zig,
so you will need the Zig compiler,
which is called zig
in most package managers.
You can also download a static build if it's not packaged for you.
To build and install the program:
zig build -Doptimize=ReleaseSafe --prefix ~/.local
It installs an executable file in $PREFIX/bin
,
so that should be in your $PATH
.
To run the tests:
zig build test
To build the manpage:
zig build doc
If you don't need full Unicode support, you can disable it, to save some space:
zig build -Dunicode=false
Use passphrase -h
to see the available options.
Use passphrase < path/to/one-word-per-line.txt
or command-that-outputs-one-word-per-line | passphrase
for a custom wordlist. A single word longer than 31 bytes will result in an error.
If the output is piped into another command,
for example passphrase | wl-copy
to put the passphrase in the clipboard,
the ending newline is omitted, so that it can be safely pasted.