Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 446 Bytes

109.md

File metadata and controls

24 lines (17 loc) · 446 Bytes
@author jackzhenguo
@desc 
@date 2019/10/10

109 32位加密

import hashlib
# 对字符串s实现32位加密


def hash_cry32(s):
    m = hashlib.md5()
    m.update((str(s).encode('utf-8')))
    return m.hexdigest()


print(hash_cry32(1))  # c4ca4238a0b923820dcc509a6f75849b
print(hash_cry32('hello'))  # 5d41402abc4b2a76b9719d911017c592
[上一个例子](108.md) [下一个例子](110.md)