Skip to content

Commit

Permalink
Replace wordlist.json with wordlist.py
Browse files Browse the repository at this point in the history
Go back to using a Python tuple from a module for the wordlist, because
loading the json was costing as much as 3 times the runtime.
  • Loading branch information
HacKanCuBa committed Nov 25, 2017
1 parent 31c23e0 commit 2c0eb8b
Show file tree
Hide file tree
Showing 3 changed files with 7,783 additions and 10 deletions.
12 changes: 3 additions & 9 deletions passphrase/passphrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,9 @@ def __str__(self) -> str:
def load_internal_wordlist(self) -> None:
"""Load internal wordlist."""

from json import loads as json_loads
from pkg_resources import resource_string

wordlist = json_loads(resource_string(
'passphrase',
'wordlist.json'
).decode('utf-8'))
self.wordlist = wordlist['wordlist']
self._wordlist_entropy_bits = wordlist['entropy_bits']
from .wordlist import EFF_LONG_WORDLIST, EFF_LONG_WORDLIST_ENTROPY
self.wordlist = EFF_LONG_WORDLIST
self._wordlist_entropy_bits = EFF_LONG_WORDLIST_ENTROPY
self._external_wordlist = False

@staticmethod
Expand Down
1 change: 0 additions & 1 deletion passphrase/wordlist.json

This file was deleted.

Loading

0 comments on commit 2c0eb8b

Please sign in to comment.