python中md5加密用法

def md5(user):
    import hashlib
    import time

    ctime = str(time.time())
    m = hashlib.md5(bytes(str(user), encoding="utf-8"))
    m.update(bytes(ctime, encoding="utf-8"))
    return m.hexdigest()

猜你喜欢

转载自blog.csdn.net/weixin_42289273/article/details/115322338