---
title: "python成功引入MD5"
author: "caiquan"
date: "2011-07-31T12:18:13Z"
tags: []
categories: ["编程语言"]
slug: "python-md5"
draft: false
lastmod: "2011-07-31T12:18:13Z"
id: 1136601
url: "https://caiquan.iteye.com/blog/1136601"
---

```
# ----成功引入MD5
import hashlib
import random
x=hashlib.md5(str(random.randint(1,10))).hexdigest()
print x

#-----取随机数
print random.randint(1,10)
```

python中把字符串换成MD5的方法。

python的随机数