Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python3
from passlib.hash import bcrypt_sha256
print('u/u', end='')
try:
bcrypt_sha256.verify('admin', '$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu')
print(' +')
except TypeError:
print(' F')
print('b/u', end='')
try:
bcrypt_sha256.verify(b'admin', '$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu')
print(' +')
except TypeError:
print(' F')
print('u/b', end='')
try:
bcrypt_sha256.verify('admin', b'$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu')
print(' +')
except TypeError:
print(' F')
print('b/b', end='')
try:
bcrypt_sha256.verify(b'admin', b'$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu')
print(' +')
except TypeError:
print(' F')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment