點選檢視程式碼
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)