1
0
Fork 0
mirror of https://github.com/eosswedenorg/eosio-keygen-extras synced 2026-06-16 05:04:54 +02:00

Initial commit (taken from eosio-keygen repo)

eosio-keygen commit: 2c9c3d2ed979b7a0d324303e746ab715e3c6abee
This commit is contained in:
Henrik Hautakoski 2020-03-13 18:20:50 +01:00
commit a26b8543d1
10 changed files with 96884 additions and 0 deletions

34
.github/workflows/package.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Package
on:
release:
types: [ created ]
jobs:
# Debian package
ubuntu:
name: Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Configure
run: cmake -B build --config Release .
- name: Package
id: package
run: |
cmake --build build --target package
FILE=$(ls build/*.deb | head -1)
echo "::set-output name=filename::$FILE"
echo "::set-output name=name::$(basename $FILE)"
- name: Upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ steps.package.outputs.name }}
asset_path: ${{ steps.package.outputs.filename }}
asset_content_type: application/x-deb

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
build/

41
CMakeLists.txt Normal file
View file

@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.4)
# Project name and version
project(eosio-keygen-extras
VERSION 0.1.0
DESCRIPTION "extra files for eosio-keygen"
HOMEPAGE_URL "https://github.com/eosswedenorg/eosio-keygen-extras"
LANGUAGES NONE
)
set( PROJECT_MAINTAINER "Henrik Hautakoski <henrik@eossweden.org>")
include(GNUInstallDirs)
# --------------------------------
# Install target
# --------------------------------
install(
DIRECTORY dict
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}
)
# --------------------------------
# Package
# --------------------------------
if (UNIX)
set( CPACK_GENERATOR "DEB" )
set( CPACK_DEBIAN_PACKAGE_DEPENDS "eosio-keygen" )
set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all" )
set( CPACK_DEBIAN_PACKAGE_RELEASE "1" CACHE STRING "Debian release number" )
set( CPACK_DEBIAN_PACKAGE_SECTION "extras" )
set( CPACK_DEBIAN_FILE_NAME "${PROJECT_NAME}_${PROJECT_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb" )
else()
set( CPACK_GENERATOR "ZIP" )
endif()
# Info
set( CPACK_PACKAGE_CONTACT ${PROJECT_MAINTAINER} )
include( CPack )

23
README.md Normal file
View file

@ -0,0 +1,23 @@
# eosio-keygen-extras
extra files for eosio-keygen.
Right now this repository provides custom dictionary files that can be used to find vanity keys.
## Creating/Updating dictionaries.
This repo contains some useful scripts to automatically generate and update dictionaries:
* `generate-dict.sh`: convert a list of words to a list suitable for eosio-keygen.
input is read from stdin and should have words separated by newline. output is written to stdout.
* `update-dict.sh`: Reads `config.json` and combines input files. then calls `generate-dict.sh` that generates the output file in `dict/` directory.
## Acquire input dictionaries.
on debian based distros. there are some packages with different lists [here](https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=all&keywords=dictionary+words+for+%2Fusr%2Fshare%2Fdict)
## Author
Henrik Hautakoski - [henrik@eossweden.org](mailto:henrik@eossweden.org)

8
config.json Normal file
View file

@ -0,0 +1,8 @@
{
"english": [
"/usr/share/dict/american-english",
"/usr/share/dict/british-english",
"english-custom"
],
"swedish": "/usr/share/dict/swedish"
}

8
custom/english Normal file
View file

@ -0,0 +1,8 @@
bitcoin
bos
btc
dac
eos
eosio
swe
wax

47032
dict/english Normal file

File diff suppressed because it is too large Load diff

49697
dict/swedish Normal file

File diff suppressed because it is too large Load diff

15
generate-dict.sh Normal file
View file

@ -0,0 +1,15 @@
#!/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

25
update-dict.sh Normal file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Updates the dictionary files defined in config.json.
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
EXTRAS_DIR=${BASE_DIR}/../extras
CONFIG=${EXTRAS_DIR}/dict.json
for lang in $(jq -r 'keys[]' $CONFIG); do
echo "- Generating: $lang"
files=()
for f in $(jq -r ".$lang | if type==\"array\" then .[] else . end" $CONFIG); do
if [ "${f:0:1}" != "/" ]; then
f="$EXTRAS_DIR/$f"
fi
files+=( "$f" )
done
grep -hs ^ ${files[@]} | $BASE_DIR/generate-dict.sh > $EXTRAS_DIR/dict/$lang
done
echo "Done"