UUID 重复?
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
public class UUID {
public static void main(String[] args) {
final int x = Integer.parseInt(args[0]);
final int y = Integer.parseInt(args[1]);
final String[][] uuids = new String[x][y];
final int[] ks = new int[x];
for(int j = 0; j < x; j++) {
final int k = j;
new Thread(new Runnable(){
public void run() {
for(int i = 0; i < y ; i++) {
uuids[k][i] = getUUID();
}
System.out.println(k + " Over.");
ks[k] = 1;
}
}).start();
}
while(true) {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
boolean flag = true;
for(int i = 0; i < ks.length; i++) {
if(ks[i] == 0) {
flag = false;
}
}
if(flag) {
break;
}
}
System.out.println("Process UUID");
HashSet<String> set = new HashSet<String>(uuids.length);
List<String> list = new ArrayList<String>();
for(int i = 0; i < uuids.length; i++) {
for(int j = 0; j < uuids[i].length; j++) {
if(!set.add(uuids[i][j])) {
list.add(i + "#" + j + "#" + uuids[i][j]);
System.out.print(uuids[i][j] + "| ");
} else {
System.out.print(uuids[i][j] + "| ");
}
}
System.out.println();
}
System.out.println("Process UUID ["+set.size()+"]");
System.out.println(list);
}
public static String getUUID() {
String s = java.util.UUID.randomUUID().toString();
return s.substring(0, 8) + s.substring(9, 13) + s.substring(14, 18)
+ s.substring(19, 23) + s.substring(24);
}
}
5 Over.
0 Over.
8 Over.
4 Over.
6 Over.
9 Over.
2 Over.
3 Over.
7 Over.
1 Over.
Process UUID
111a259c52fb4ea7b313fe33cd2b1a56| def2c8f802e546b49594498809349d9f| 89c3b3bb1772471d9275f763cc82a655| e1af69b5744d4bf69b19b3425c5ac355| a46218ea0f574444b3c8af738e6d05cc| d8df2b2741b24d3ca672d7f9bc78e3c1| 4223d0ca2bf944bb8d64a7867e150dd3| 023deb9163784ccebb0703a778fa03eb| 96763ee8c91c45b1a21435c1031dcbde| 033070ce7d2f4614b700a1ffaffaaa3e|
333bf61aa8634e47b2d1f7df150d979f| ec2d4226cf3c4299aad3e97f246f0142| 073aed8d9d8748668c377875bf7e9a6e| fe87c53421cc4505b75dacc3b7928fa5| 1c9a6af7699d433ea4652c3514c4cfc6| f0d74353fa8946a19803609f06d32865| 9ccda1bce1ec4de08751a764f75bc8b0| e98cac7671ab4e1fa345cb5ebbf5f2da| 324089828b4a419e9c2487f2e2ea4f24| a6ec9e64bae24ea0a710d58e522b4de2|
cf2bf25509014e52982807c5a8d9c5d4| cdb6b5324f854b9d83d9c13c132e77f1| 2e1744970d2c4c3484743b3e0a147e99| 33009f87cde14e12ad59687acf7ec9e7| e4c133edc254472dba68853a50428d79| 89c833fef714490ea3f381843ae2e551| 8c1ea95e616f477383e4d7176b759da0| f4459e074ade466683433d1dc594fc5a| 11ef5a7199f24372ad88db69d68faac8| df197fdee0d74602809e76b965ebeb7f|
c4c2a850be104db9b7d41160534938c5| f2bb56c27f884cfcb31e218de6d6e4b2| 1bd40a566ca94f0b804d7c9531174874| be9dac6ce5ed44868044d1064fc56dc8| d5c1e4c19d1d41169e4d660e90a537b6| 85ba87dc52af4b648d671da289f1bfb9| 19229b03f5974c7c93918979029d41fd| eed6b3f6a8ea4e84b14d29dc3733523c| 86b962d554094bddafe3f271fe0b63a4| 59ebdc9463fd4ba0ad8ed7c1f36632f9|
6654487027d34877af2baedefa90f59a| f0af4400bae34ee9b3aaa26f5eb5b7d1| 771d748b63ac4e2c9ac822199c984667| 3d8f4443720245d9a2b4f822ad8ae5d0| 513d79eeb16b461ca1ec549fd54ec709| 6fc2a02fc70c4f15baa0316d4901d74d| fea0ef82baf442e4bd2931e002e95dae| 200cd15ac49446e0abfec9d5526cd5b6| 48e2b7118cfe4f96b2f513b9ba9871bb| a167bb66880d4ce38779a64439255673|
9b5c9f50fdfa4414b1180a0bbed9b34f| 43156bc3897a4156a3d2e9d2a73b6677| 510d51eff3204412af4f2b2b18030aba| 0dfe8dca76464a7ab1705691df9e8370| 81da5ae024244fdaacc1b92104956f4e| dd2c42697c924b47a23099db3b1afc35| aab508823d174939b9c48030c25536d7| cea7d8f6700c424ea7ab03d923147c8a| 8b69c816c1e547769341cde9c8d78453| 6ee86e999ab04c9d947bf4f722474b0e|
a8e6a1c6db68473ea6a795735ece1706| 855237a44dc04af4a64e5e4c42622061| 5be2750e59a64808a8fda49a07322adf| 305d02aba2154164bf0d22d7b7ca9843| 5a0c48ff4df24628b6c0c672d80a6564| a2477102c63e49748baa7b6e129f36a7| a002680eb3cf4d7ba0a05bed454f91fa| 5e653a6c826548139af0622486131674| 3ee588f2d65143c5bcb7eb45d7989834| 456c3f6b7e104801bfb2721897066585|
fa505f3f6de146e7bbf0ddf1dc9e5ab0| 6c3ab749c7b347bb889e56a37537b8ce| 145215b900774154b5bbc657190a8461| ce4bc81f84fe4104bfc5fd5ad74b30dc| 3ccedac3e0984e87af06dbb47408549c| a5151cb341844ade99f2d33b8ff7a0cb| b0f5e188cc674a78b8171824c6d8a89e| 49761db468d94ffe8f794277dfc3e30a| f52922151bd34c94bead9918788ca094| eae9b4153ff74779b2fd99d5436bdbe6|
111a259c52fb4ea7b313fe33cd2b1a56| b162447a84b149caa53c21bea7f66125| 574d68eb825c406681698beecdf79f68| af4780ee2bd849b3a1edfb6bfa7b17c6| 6b19a03fd4744d7a8681f66a4560e612| b0da2834af384b318d491026840c1a78| 106a084b0d70480a8ddec98ddd25f7aa| 81f17d11ea52415abecdbd26471b8a16| d32a6dcc477643d18627f65721753a92| fc3d1d68cdca47e9b973d36dab0845c0|
dbaa05fe045b452792c36d6285e8dde1| 7af895e5734b4ef5bf639ec6a2c5c7d7| 0a5aef1b9b434fac9dcad6d5c6e3c30a| 99dff71b520643328ec3dae601848362| 42b8b812a81d4292a771b0a98a495ca1| 4bc57d3dd04241599088a751ea9d0b62| 83ea97cec9ea459eaac1fe632eaca957| 3775f3835347404ca62d277053acb953| bf69fc6c2c3949fc8e0cc59bbcdd35a4| 6689217ab4454b9fab162c56293adacb|
Process UUID [99]
[8#0#111a259c52fb4ea7b313fe33cd2b1a56]
UUID是指在一台机器上生成的数字,它保证对在同一时空中的所有机器都是唯一的。通常平台会提供生成的API。按照开放软件基金会(OSF)制定的标准计算,用到了以太网卡地址、纳秒级时间、芯片ID码和许多可能的数字
UUID由以下几部分的组合:
(1)当前日期和时间,UUID的第一个部分与时间有关,如果你在生成一个UUID之后,过几秒又生成一个UUID,则第一个部分不同,其余相同。
(2)时钟序列。
(3)全局唯一的IEEE机器识别号,如果有网卡,从网卡MAC地址获得,没有网卡以其他方式获得。
UUID的唯一缺陷在于生成的结果串会比较长。关于UUID这个标准使用最普遍的是微软的GUID(Globals Unique Identifiers)。在ColdFusion中可以用CreateUUID()函数很简单地生成UUID,其格式为:xxxxxxxx-xxxx- xxxx-xxxxxxxxxxxxxxxx(8-4-4-16),其中每个 x 是 0-9 或 a-f 范围内的一个十六进制的数字。而标准的UUID格式为:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx (8-4-4-4-12),可以从cflib 下载CreateGUID() UDF进行转换。
6 Over.哈哈,lz代码的问题,问题见下楼
8 Over.
2 Over.
5 Over.
3 Over.
0 Over.
7 Over.
1 Over.
4 Over.
9 Over.
Process UUID
6356d81ec33446ceaf4c27301aadea15
[解决办法]
660d89f7e25e4fb790be2b8cf0b4d15f
[解决办法]
0c163aa5cbaa4b8fb19a844611736017
[解决办法]
a8399c4f864f4fb4b36e6df31b7c69fa
[解决办法]
153c11934fba44669987752156c58c4d
[解决办法]
b169a8af0a0e42c69b526d52544b6ede
[解决办法]
9c94f2bd4f984d119ca8540cfcce3878
[解决办法]
706dcb5c3a5744688d4e56c87878bdbd
[解决办法]
14c92280375f426bbd0147ad2a52d949
[解决办法]
827a61ca70a5492dad803fe9b50f3edf
[解决办法]
f269d744d83f44dbba7a056fb9e738f2
[解决办法]
669bf01d808b44abaecefeade10e246c
[解决办法]
03fd19dbeebb42cd8dbde0b1bd226e30
[解决办法]
7c2609d7a14148649ae6ae1d0db513b3
[解决办法]
47a2144195734d0e914a3235ed3dac95
[解决办法]
0dc271a9892943999e06291fd539351a
[解决办法]
1a3d8c979c864f2d8eabb5cc6b2fadbe
[解决办法]
660dd077bc0f47e0b4ebf389ec3cb89c
[解决办法]
21e0d065429948518f137fef6c0c8177
[解决办法]
4aae77b036c54a0d999e42d9aeecbc12
[解决办法]
6356d81ec33446ceaf4c27301aadea15
[解决办法]
c3f85398b5a34a719ea897868b0c7bc6
[解决办法]
22efb322209f465ca41dd93a7cb878ed
[解决办法]
deb38d0e2a9b4f26af94d4a854c40600
[解决办法]
f5bcd1f663ab4552b234e6a117e590e7
[解决办法]
9370eb8e2d9d48fa8c7a15d8e207915d
[解决办法]
9420af1d40b94986b565ebd2bedb552c
[解决办法]
2fcf4e33eb20432fa570696206b0dbf4
[解决办法]
e8e8e531547449928c50d5064f264f8c
[解决办法]
d462c881d6b343389ef24e72c51f67e3
[解决办法]
596d087709194d88a8f06c3f48444208
[解决办法]
6172d1ac6a044969a26b1e838bc5960a
[解决办法]
763a96366a144ce683ce7dbfbdd5b569
[解决办法]
a7487ca688cd4bd781a6e72a705ef834
[解决办法]
98877b7473ec49a78e102821b38a4d37
[解决办法]
bb81a6ab783c4ac497dd3accedf822cc
[解决办法]
e3d0e647dc87470ba30b28752ef040f6
[解决办法]
91cf2f932c9d4a57b34d8dc89cd8f621
[解决办法]
61aa47b4b3b1426f8aadad0d5d6083f5
[解决办法]
e64f02a897894a65ab665db9058bfebf
[解决办法]
8fab09b08d4541fc9d7e989701896afe
[解决办法]
43950dedebfa45e0896e005348650819
[解决办法]
b49ad6f3edd94c2f9fc0158987a77332
[解决办法]
77e137533dc847d89148bec3d2a4c2dd
[解决办法]
fbe7524a54044e2c994c985288e6547c
[解决办法]
6a72a933787e4b62a36440c4f459fa03
[解决办法]
6f030d3507a54bf492b5187d261f5475
[解决办法]
9a996131274f4e4882453a5e922ef518
[解决办法]
640ce7c2f77343d7b23cf871e3e6ecc3
[解决办法]
01188380cf1247839c25d1e8e2acb60a
[解决办法]
f269d744d83f44dbba7a056fb9e738f2
[解决办法]
8d6b0208f3264fb9acb2a894f4faa67d
[解决办法]
5c6542acbebd4a2c9707cd4079d0a1c7
[解决办法]
4a09cd435db342198633581c0fd92a47
[解决办法]
08ca8d65a542488dbd72a59d2a9f12de
[解决办法]
d40e2a10fc3344d0a59efbf52a68a52e
[解决办法]
c2bdc96417054151bbe54b21d3ac242b
[解决办法]
1cb621657eee495d9d7faaa9affea50f
[解决办法]
29edf7de65724525869a8fd051586891
[解决办法]
0c0a37f1d9d14219a2887676aed9dd46
[解决办法]
6356d81ec33446ceaf4c27301aadea15
[解决办法]
2df78fdf909f408485168693cc69e6d3
[解决办法]
2fc089771c934d20bf561650dd1e6990
[解决办法]
40328717e9ab4a2ea97bffe6444dc969
[解决办法]
a046dacf50e54279b26713a7822cea82
[解决办法]
062bc2fe07e64ef289d7c8d4ebf2e88f
[解决办法]
7788c441f5c5486aa33b39418c7955e2
[解决办法]
3aeabe9e88f3486db0c2a738600c91da
[解决办法]
0a087ce4c8094c30a8185883dd180b58
[解决办法]
9890182dcfac4509be0890125d57e91a
------解决方案--------------------
6356d81ec33446ceaf4c27301aadea15
[解决办法]
6c49b6205b6b42d78a12fee7ad9d6863
[解决办法]
c8f5afef0fe64e2ead5716e221f32a60
[解决办法]
7a793947e26849ac9cd68fb3046a5f48
[解决办法]
d1157f589c6f4455a62d38d160dbf02e
[解决办法]
f595f8d61cf8473c975b233ec4ea8971
[解决办法]
af31473dea014cf49278b224c2bc4dca
[解决办法]
66653cd1fc0447e2b3f51e7da99db26e
[解决办法]
04baad3118824899937374a4dc003c86
[解决办法]
a808ab650bc442d28901adb2e33b5986
[解决办法]
6356d81ec33446ceaf4c27301aadea15
[解决办法]
bda1faff329d4ac1a8cff449edf9b425
[解决办法]
be27ee7afef142288e84f336b0b249b8
[解决办法]
2d672c6c16b847a09e32315916e184eb
[解决办法]
e84375c01a014a6b8a4211cface07f1d
[解决办法]
0ff67695eeac49a192d8c2bf5b9b40e8
[解决办法]
55d2e31337b2444793fb4a30bd2d7702
[解决办法]
39fa9392518d4573965e6e3ba2c75ca9
[解决办法]
2791886c88b84a9a94e6a1feb604c2f5
[解决办法]
cedec90389cf44e9a6d7ee4c00d3b394
[解决办法]
e54065d557634b5492ad3ffe991450d8
[解决办法]
c09c252beeef42049e4bf9e071449086
[解决办法]
e3fad258f5e446ceaab25cc7da98a96d
[解决办法]
d5e89d29bb3743bfba17b7a7dd8ad97c
[解决办法]
ceaee7ac199b41e5858215636141029e
[解决办法]
b30a37a926b040a08f93eff9d64e2d1d
[解决办法]
5746f8e242af469696289eea597a6cb2
[解决办法]
fc62da22ce124546822b1042d6a80686
[解决办法]
0d7fc25c779f48e8949374ce7d1fcdef
[解决办法]
c9c8127adf26401081bb2842dc89ba14
[解决办法]
Process UUID [95]
[2#0#6356d81ec33446ceaf4c27301aadea15, 5#0#f269d744d83f44dbba7a056fb9e738f2, 6#0#6356d81ec33446ceaf4c27301aadea15, 7#0#6356d81ec33446ceaf4c27301aadea15, 8#0#6356d81ec33446ceaf4c27301aadea15]