乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      序號號生成工具

       印度阿三17 2019-03-10
      package cn.xxxx.tools;
      
      import java.util.Random;
      
      
      
      public class Test {
      
      
      
      public static void main(String[] args){
      	Member member = new Member();
      	member.setMemberId(SerialNumberUtil.generateId());
      	System.out.println(SerialNumberUtil.generateId());
      	member.setAccount("abc");
      	String password = "123456";
      	password = CipherUtil.MD5Encode(password);
      	String sort = getCode();
      	member.setPwdSalt(sort);
      	member.setPwd(CipherUtil.MD5Encode(password   sort));
      }
      
      private static String getCode() {
      	Random rd = new Random();
      	return new StringBuilder().append(rd.nextInt(10))
      			.append(rd.nextInt(10)).append(rd.nextInt(10))
      			.append(rd.nextInt(10)).append(rd.nextInt(10))
      			.append(rd.nextInt(10)).toString();
      }
      }
      
      
      //0100P1K3B1XP15K8B1AB
      //0100U1K3W1XJ15KOO967
      //010021K331XL15LBBON8
      package cn.xxxx.tools;
      
      import java.io.FileInputStream;
      import java.io.FileNotFoundException;
      import java.io.IOException;
      import java.io.InputStream;
      import java.io.Serializable;
      import java.util.Calendar;
      import java.util.Properties;
      import java.util.UUID;
      import java.util.concurrent.ThreadLocalRandom;
      
      
      public class SerialNumberUtil
        implements Serializable
      {
        private static final long serialVersionUID = 1591908593776625336L;
        private static final char[] _a = { '0', '1', '2', '3', '4', '5', '6', '7', '8', 
          '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 
          'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 
          'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 
          'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 
          'z' };
        private static final char[] _b = { '0', '1', '2', '3', '4', '5', '6', '7', '8', 
          '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 
          'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
        private static final Properties prop = new Properties();
        
        static
        {
          //InputStream inStream = SerialNumberUtil.class.getClassLoader().getResourceAsStream("XXX.properties");
          FileInputStream in=null;
      	try {
      		in = new FileInputStream("E:\\XXX.properties");
      	} catch (FileNotFoundException e) {
      		e.printStackTrace();
      	}
      
          try
          {
            prop.load(in);
            //inStream.close();
          }
          catch (IOException localIOException) {}
        }
        
        private static ThreadLocal<StringBuilderHelper> tl = new ThreadLocal()
        {
          protected SerialNumberUtil.StringBuilderHelper initialValue()
          {
            return new SerialNumberUtil.StringBuilderHelper();
          }
        };
        private static ThreadLocal<char[]> chartl = new ThreadLocal()
        {
          protected char[] initialValue()
          {
            return new char[20];
          }
        };
        
        private static void to36String(int number, int offset, char[] buf, int charPos)
        {
          char[] chars = (char[])chartl.get();
          while (number >= 36)
          {
            buf[(--charPos)] = _b[(number % 36)];
            number /= 36;
          }
          buf[(--charPos)] = _b[number];
          System.arraycopy(buf, 0, chars, offset, buf.length);
        }
        
      
        
        public static String generateUUID(String str)
        {
          return UUID.fromString(str).toString().replace("-", "").toUpperCase();
        }
        
        public static String generateUUID(byte[] bytes)
        {
          return UUID.nameUUIDFromBytes(bytes).toString().replace("-", "").toUpperCase();
        }
        
        public static String generateId()
        {
          char[] chars = (char[])chartl.get();
          Calendar calendar = Calendar.getInstance();
          ThreadLocalRandom rd = ThreadLocalRandom.current();
          prop.getProperty("ServerNo").getChars(0, 2, chars, 0);
          chars[3] = 48;chars[2] = 48;
          chars[4] = _b[rd.nextInt(36)];
          to36String(calendar.get(1), 5, new char[] { '0', '0', '0' }, 3);
          chars[8] = _b[rd.nextInt(36)];
          to36String(calendar.get(6), 9, new char[] { '0', '0' }, 2);
          chars[11] = _b[rd.nextInt(36)];
          to36String(calendar.get(11) * 60 * 60   
            calendar.get(12) * 60   
            calendar.get(13), 12, 
            new char[] { '0', '0', '0', '0' }, 4);
          chars[16] = _b[rd.nextInt(36)];
          to36String(calendar.get(14), 17, new char[] { '0', '0' }, 2);
          chars[19] = _b[rd.nextInt(36)];
          return new String(chars);
        }
        
        public static String generateId(String groupId, String serialNo)
        {
          char[] chars = (char[])chartl.get();
          Calendar calendar = Calendar.getInstance();
          ThreadLocalRandom rd = ThreadLocalRandom.current();
          if (groupId.matches("[0-9a-zA-Z]{2}")) {
            groupId.toUpperCase().getChars(0, 2, chars, 0);
          } else {
            throw new IllegalArgumentException("集團組織必須為2位長!");
          }
          if (serialNo.matches("[0-9a-zA-Z]{2}")) {
            serialNo.toUpperCase().getChars(0, 2, chars, 2);
          } else {
            throw new IllegalArgumentException("單據編號必須為2位長!");
          }
          chars[4] = _b[rd.nextInt(36)];
          to36String(calendar.get(1), 5, new char[] { '0', '0', '0' }, 3);
          chars[8] = _b[rd.nextInt(36)];
          to36String(calendar.get(6), 9, new char[] { '0', '0' }, 2);
          chars[11] = _b[rd.nextInt(36)];
          to36String(calendar.get(11) * 60 * 60   
            calendar.get(12) * 60   
            calendar.get(13), 12, 
            new char[] { '0', '0', '0', '0' }, 4);
          chars[16] = _b[rd.nextInt(36)];
          to36String(calendar.get(14), 17, new char[] { '0', '0' }, 2);
          chars[19] = _b[rd.nextInt(36)];
          return new String(chars);
        }
        
       
        
        public static String to62String(long l)
        {
          StringBuilder buf = ((StringBuilderHelper)tl.get()).getStringBuilder();
          while (l >= 62L)
          {
            buf.insert(0, _a[((int)(l % 62L))]);
            l /= 62L;
          }
          buf.insert(0, _a[((int)(l % 62L))]);
          return buf.toString();
        }
        
        
        
        
        
        public static String to36String(long l)
        {
          StringBuilder buf = ((StringBuilderHelper)tl.get()).getStringBuilder();
          while (l >= 36L)
          {
            buf.insert(0, _b[((int)(l % 36L))]);
            l /= 36L;
          }
          buf.insert(0, _b[((int)(l % 36L))]);
          return buf.toString();
        }
        
       
        static class StringBuilderHelper
        {
          final StringBuilder sb;
          
          StringBuilderHelper()
          {
            this.sb = new StringBuilder();
          }
          
          StringBuilder getStringBuilder()
          {
            this.sb.setLength(0);
            return this.sb;
          }
        }
      }
      

      XXX.properties 內容

      ServerNo=01
      

      ?

      來源:http://www./content-4-136151.html

        本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
        轉藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約