java通过jdk自带的UUID,生成32位的随机串
private static String generate_UUID() {
UUID uuid=UUID.randomUUID();
String str = uuid.toString();
System.out.println("str: " + str); // bb01a3cd-987f-469d-9e0f-04dffa2d3278
return str.replace("-", ""); // bb01a3cd987f469d9e0f04dffa2d3278
}
UUID生成的str是36位,去掉 “-” 后,是32位