Skip to content

Commit

Permalink
Expose Passphrase and Aux classes to package level
Browse files Browse the repository at this point in the history
Update Developers guide with this.
  • Loading branch information
HacKanCuBa committed Sep 6, 2018
1 parent 27b2916 commit dec7b4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DEVELOPERS.md
Expand Up @@ -71,7 +71,7 @@ Please let me know if you use this in your app, I would love that :)
A good example is how [I implemented it](passphrase/__main__.py).

```python
>>> from passphrase.passphrase import Passphrase
>>> from passphrase import Passphrase
>>> passphrase = Passphrase('/tmp/mi_own_wordlist.txt')
>>>
>>> # WARNING: entropy and good default values ARE NOT automatically calculated!
Expand Down Expand Up @@ -113,7 +113,7 @@ ValueError: Cant' calculate the words amount needed: entropy_bits_req or amount_
# use, or a safe password.

def generate_passphrase() -> str:
from passphrase.passphrase import Passphrase
from passphrase import Passphrase
# Use internal wordlist (if it doesn't exists, an exception raises)
passphrase = Passphrase('internal')
passphrase.entropy_bits_req = 77 # EFF's minimum recommended
Expand All @@ -126,7 +126,7 @@ def generate_passphrase() -> str:
return proposedPassphrase

def generate_password() -> str:
from passphrase.passphrase import Passphrase
from passphrase import Passphrase
passphrase = Passphrase()
passphrase.entropy_bits_req = 77 # EFF's minimum recommended
passphrase.passwordlen = passphrase.password_length_needed()
Expand Down
4 changes: 4 additions & 0 deletions passphrase/__init__.py
@@ -0,0 +1,4 @@
from .passphrase import Passphrase
from .aux import Aux

__all__ = ('Passphrase', 'Aux', )

0 comments on commit dec7b4d

Please sign in to comment.