在Python3中可以使用hashlib库来实现MD5加密。
以下是一个示例代码:
import hashlibdef md5_encrypt(text): md5 = hashlib.md5() md5.update(text.encode('utf-8')) return md5.hexdigest()text = "hello world"encrypted_text = md5_encrypt(text)print(encrypted_text)运行以上代码,将输出5eb63bbbe01eeed093cb22bb8f5acdc3,这就是hello world的MD5加密结果。


