1
0
Fork 0
mirror of https://github.com/eosswedenorg/eosio-keygen-extras synced 2026-06-16 05:04:54 +02:00
eosio-keygen-extras/generate-dict.sh
Henrik Hautakoski a26b8543d1 Initial commit (taken from eosio-keygen repo)
eosio-keygen commit: 2c9c3d2ed979b7a0d324303e746ab715e3c6abee
2020-05-29 13:59:48 +02:00

15 lines
580 B
Bash

#!/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