10 获取md5加密值
import hashlib
def get_md5(data):
obj = hashlib.md5()
obj.update(data.encode('utf-8')) #转换成encode
result = obj.hexdigest()
return result
val = get_md5('123')
print(val)
import hashlib
def get_md5(data):
obj = hashlib.md5()
obj.update(data.encode('utf-8')) #转换成encode
result = obj.hexdigest()
return result
val = get_md5('123')
print(val)