summaryrefslogtreecommitdiffstats
path: root/lang/python/python-bcrypt/test.sh
blob: 9443614f42a07abd5cae80cf84c788974164e10a (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

[ "$1" = python3-bcrypt ] || exit 0

python3 - << EOF
import sys
import bcrypt
password = b"super secret password"
hashed = bcrypt.hashpw(password, bcrypt.gensalt())
sys.exit(0 if bcrypt.checkpw(password, hashed) else 1)
EOF