1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-17 03:50:03 +02:00
antelope-keygen/scripts/generate-dict.sh
Henrik Hautakoski eeff86feee scripts/generate-dict.sh: Change the order of operations.
Should remove <=2 length words first then convert to lowercase then remove non base58 lines.
2020-02-17 19:37:00 +01:00

15 lines
580 B
Bash
Executable file

#!/usr/bin/env bash
# Generates a dictionary file for usage with eosio-keygen
# - input is read from stdin and should have words separated by newline.
# - output is written to stdout.
BASE58_ALPHABET=123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
# 1. Remove lines that are 2 or less characters long
# 2. Convert to lowercase
# 3. Remove any line that contains non base58 characters
# 4. Sort and remove duplicate lines.
LC_CTYPE=C sed -r '/^.{,2}$/d' < /dev/stdin 2> /dev/null \
| tr '[:upper:]' '[:lower:]' \
| awk "! /[^${BASE58_ALPHABET}]/" \
| sort | uniq