Java通过UUID随机生成36位、32位唯一识别码(唯一字符串)

import java.util.UUID;
/**
 * 通过UUID随机生成36位、32位唯一识别码(唯一字符串)
 * @author 【J.H】
 *
 */

public class Test {

	public static void main(String[] args) {
		int i = 0;
		while (i<10) {
			String a = UUID.randomUUID().toString();
			System.out.println(a);
			System.out.println(a.length());
			String b = a.replaceAll("-","");
			System.out.println(b);
			System.out.println(b.length());
			System.out.println("*******************************");
			i++;
		}		
	}
}

猜你喜欢

转载自www.cnblogs.com/Big-Boss/p/9431679.html
今日推荐