from hashlib import md5
# md5仅能够对二进制进行加密,所以要对content进行endoce()
# TypeError: Unicode-objects must be encoded before hashing
content = 'this is a test'
md5_ret = md5(content.encode()).hexdigest()
print('md5加密后的结果: ---- ', md5_ret)
md5加密后的结果: ---- 54b0c58c7ce9f2a8b551351102ee0938