有时候为了测试,需要大量的md5,写个函数来生成:
- import string, random
- look_set = string.ascii_letters + string.digits
- md5_len = 32
- tmp_md5_ls = []
- for k in range(10):
- for i in range(md5_len):
- tmp_md5_ls.append(random.choice(look_set))
- print ''.join(tmp_md5_ls)
- tmp_md5_ls = []