Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/guides/basic-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ web](https://bcrypt-generator.com/).
Here is a python script which uses python3-bcrypt to prompt for a password and
hash it:

```
pip3 install getpass4
```

```python
import getpass
#!/usr/local/bin/python3
from getpass4 import getpass
import bcrypt

password = getpass.getpass("password: ")
password = getpass("password: ")
hashed_password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt())
print(hashed_password.decode())
```
Expand Down