首页 > 其他 > 详细

唯一码生成

时间:2015-11-14 15:14:11      阅读:224      评论:0      收藏:0      [点我收藏+]

private static String beforeBh;
private static String beforeNum;

public static String codeGenerate() {
  Date now = new Date();
  String behind = now.getTime()+"";
  if(beforeBh==null) {
   beforeBh = behind;
  } else if(beforeBh.equals(behind)) {
   behind = behind +beforeNum;
   beforeNum++;
  } else {
   beforeBh = behind;
   beforeNum = 0;
  }
  return behind;


唯一码生成

原文:http://my.oschina.net/aiaa5505/blog/530300

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