function a(a) { var d, e, b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", c = ""; for (d = 0; a > d; d += 1) e = Math.random() * b.length, e = Math.floor(e), c += b.charAt(e); return c }…
import java.util.Random; public class PasswordCreate { /** * 获得密码 * @param len 密码长度 * @return */ public String createPassWord(int len) { int random = this.createRandomInt(); return this.createPassWord(random, len); } public String createPassWord(int…
小数,字符串.时间等示例代码 String base = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 public class RandomTest { public static Random rand = new Random(); public static String dateStart = "2017-01-01 00:00:00"; /** * hh 表示12小时制 * HH 表示24小时制…
from random import Random#随机生成4到20位的用户名def random_username(): username = '' chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789-_' length = len(chars) - 1 random = Random() for i in range(4,20): username +=chars[random.randint(0,…