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小时制
SQLServer中查询的数字列前面补0返回指定长度的字符串: 如: 角本如下: /****** Script for SelectTopNRows command from SSMS ******/ SELECT TOP [ID] ,[SN] ,[Name] FROM [EduDB].[dbo].[TestTab] ',SN) from TestTab; )+CAST(SN AS varchar()),) AS 'SN' from TestTab; )),) as 'sn' from Test
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,