Blame view

ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java 1.04 KB
cee572f2   RuoYi   若依 3.0
1
  package com.ruoyi.common.utils.uuid;

46444bd0   RuoYi   RuoYi-Vue 1.0
2
  

cee572f2   RuoYi   若依 3.0
3
  import com.ruoyi.common.utils.uuid.UUID;

46444bd0   RuoYi   RuoYi-Vue 1.0
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  

  /**

   * ID生成器工具类

   * 

   * @author ruoyi

   */

  public class IdUtils

  {

      /**

       * 获取随机UUID

       * 

       * @return 随机UUID

       */

      public static String randomUUID()

      {

          return UUID.randomUUID().toString();

      }

  

      /**

       * 简化的UUID,去掉了横线

       * 

       * @return 简化的UUID,去掉了横线

       */

      public static String simpleUUID()

      {

          return UUID.randomUUID().toString(true);

      }

  

      /**

       * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID

       * 

       * @return 随机UUID

       */

      public static String fastUUID()

      {

          return UUID.fastUUID().toString();

      }

  

      /**

       * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID

       * 

       * @return 简化的UUID,去掉了横线

       */

      public static String fastSimpleUUID()

      {

          return UUID.fastUUID().toString(true);

      }

  }