def hashPassword(mapper, conneciton, target):
state = inspect(target)
hist = state.get_history("pwd", True)
if hist.has_changes() and target.pwd:
# Rounds fixed to 10 for PHP front-end compatibility
target.pwd = bcrypt.hashpw(target.pwd.encode(sg.DEFAULT_CHARSET), bcrypt.gensalt(10))
评论列表
文章目录