全部 新建

user:thomas 由使用者建立的 Gists

title:mygist Gists 的標題

filename:myfile.txt Gists 的檔案名稱

extension:yml Gists 的副檔名

language:go Gists 的程式語言

topic:homelab gists with given topic

登錄


全部 新建 登錄

All gists matching topic bcrypt

倒序排序 創建
順序排序 創建
倒序排序 更新
順序排序 更新

timmy / 🔐 Python 密碼雜湊教學:用 bcrypt 安全加密與驗證

0 喜歡
0 分支
1 檔案
最後活躍 8 months ago
用 bcrypt 進行密碼加密與驗證,支援 salt、自動安全雜湊,保護你的使用者資料不被爆破!適合登入驗證與帳號系統 🚀
authentication bcrypt login-system password-hashing python security
1 import bcrypt
2
3
4 def encode_password(password: str) -> str:
5 salt = bcrypt.gensalt()
6 hashed = bcrypt.hashpw(password.encode(), salt)
7 return hashed.decode()
8
9
10 def check_password(password: str, hashed: str) -> bool:
上一頁 下一頁

由 Opengist 提供支持 ⋅ Load: 21ms⋅

繁體中文
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文