MaxKB/apps/common/utils/common.py
2025-04-14 20:11:23 +08:00

22 lines
471 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding=utf-8
"""
@project: MaxKB
@Author虎虎
@file common.py
@date2025/4/14 18:23
@desc:
"""
import hashlib
def password_encrypt(row_password):
"""
密码 md5加密
:param row_password: 密码
:return: 加密后密码
"""
md5 = hashlib.md5() # 2实例化md5() 方法
md5.update(row_password.encode()) # 3对字符串的字节类型加密
result = md5.hexdigest() # 4加密
return result