首页 > 其他 > 详细

产生6位组合随机数

时间:2016-10-25 09:38:43      阅读:230      评论:0      收藏:0      [点我收藏+]

private static String RandomAdminId() {
  String str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  String strIndex = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

  StringBuffer strB = new StringBuffer("");
  int index = (int) (51 * Math.random());
  strB.append(strIndex.charAt(index));

  for (int i = 0; i <= 4; i++) {
    int j = (int) (61 * Math.random());
    strB.append(str.charAt(j));
  }
  return strB.toString();
}

产生6位组合随机数

原文:http://www.cnblogs.com/austinspark-jessylu/p/5995403.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!