📄 uuid.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: UUID.java
package org.huihoo.openweb.uddi;
import java.util.Random;
public class UUID
{
StringBuffer uuid;
static Random r = new Random();
public UUID()
{
uuid = new StringBuffer();
uuid.append(genKey(8));
uuid.append("-");
uuid.append(genKey(4));
uuid.append("-");
uuid.append(genKey(4));
uuid.append("-");
uuid.append(genKey(4));
uuid.append("-");
uuid.append(genKey(12));
}
public UUID(String uuid)
{
this.uuid = new StringBuffer();
this.uuid.append(uuid);
}
private String genKey(int j)
{
StringBuffer buff = new StringBuffer();
for(int i = 0; i < j; i++)
{
byte b = (byte)(Math.abs(r.nextInt()) % 16);
char c = (char)(b < 10 ? 48 + b : 65 + b);
buff.append(c);
}
return buff.toString();
}
public String toString()
{
if(uuid != null)
return uuid.toString();
else
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -