UnisKB/apps/common/utils/common.py

22 lines
471 B
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 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