獲取八位UUID標識碼

           public static String[] chars = new String[]
                {
                    "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",
                    "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"
                };

            public static String getShortUuid() {
              StringBuffer stringBuffer = new StringBuffer();
              String uuid = UUID.randomUUID().toString().replace("-", "");
              for (int i = 0; i < 8; i++) {
                String str = uuid.substring(i * 4, i * 4 + 4);
                int strInteger = Integer.parseInt(str, 16);
                stringBuffer.append(chars[strInteger % 0x3E]);
              }

              return stringBuffer.toString();
            }

          posted on 2016-01-19 15:17 Mr.lu 閱讀(3378) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2016年1月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 周口市| 介休市| 新密市| 陵水| 朝阳县| 正镶白旗| 郧西县| 新昌县| 江源县| 普兰县| 耒阳市| 岱山县| 泾川县| 黔江区| 红桥区| 万源市| 方城县| 白银市| 翁源县| 贺兰县| 邳州市| 蓬安县| 阿合奇县| 岱山县| 阳谷县| 安仁县| 横山县| 正定县| 博客| 北辰区| 顺平县| 彩票| 两当县| 南华县| 崇州市| 长沙县| 和龙市| 泽普县| 长宁县| 太仓市| 博乐市|