Skip to content

Instantly share code, notes, and snippets.

@saccadic
Created February 25, 2022 07:02
Show Gist options
  • Save saccadic/715349466f41faaceddf4665e5de9faf to your computer and use it in GitHub Desktop.
Save saccadic/715349466f41faaceddf4665e5de9faf to your computer and use it in GitHub Desktop.
ハッシュによるパスワード認証
import bcrypt
password = b"test123456"
salt = bcrypt.gensalt()
hashed = bcrypt.hashpw(password,salt)
print(hashed)
if bcrypt.checkpw(password, hashed):
print("照合されました")
else:
print("照合されませんでした")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment