中国算力平台算力登记系统2.0
yanzhaofeige
3 days ago 5cc82f45d73865489cc39e5ffbf521bf4279ec53
commit | author | age
43dc29 1 package com.odcc.cpzidc.common.utils.uuid;
Y 2
3 /**
4  * ID生成器工具类
5  * 
6  * @author ruoyi
7  */
8 public class IdUtils
9 {
10     /**
11      * 获取随机UUID
12      * 
13      * @return 随机UUID
14      */
15     public static String randomUUID()
16     {
17         return UUID.randomUUID().toString();
18     }
19
20     /**
21      * 简化的UUID,去掉了横线
22      * 
23      * @return 简化的UUID,去掉了横线
24      */
25     public static String simpleUUID()
26     {
27         return UUID.randomUUID().toString(true);
28     }
29
30     /**
31      * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID
32      * 
33      * @return 随机UUID
34      */
35     public static String fastUUID()
36     {
37         return UUID.fastUUID().toString();
38     }
39
40     /**
41      * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID
42      * 
43      * @return 简化的UUID,去掉了横线
44      */
45     public static String fastSimpleUUID()
46     {
47         return UUID.fastUUID().toString(true);
48     }
49 }