下面的代码实现了MD5值的生成: public class MD5Test2 { public static void main(String[] args) { System.out.println(MD5Test2.MD5Operation("hello")); System.out.println(MD5Test2.getMD5("hello")); } //通过java.math包的BigInteger类实现十六进制的转换 public final stat
import hashlibimport sysreload(sys)sys.setdefaultencoding('utf-8') m = hashlib.md5()m.update('123456abc')pas = m.hexdigest()print pas E:\work\venv\Scripts\python.exe E:/work/sj_zol/text.py df10ef8509dc176d733d59549e7dbfaf Process finished with exit c
利用Python生成随机域名等随机字符串. #!/usr/bin/env python# -*- coding: utf-8 -*- from random import randrange, choice from string import ascii_lowercase as lc from sys import maxsize from time import ctime tlds = ('com', 'edu', 'net', 'org', 'gov') for i in range(