1
zj
2024-06-03 09206aedcfdf30050123e99f2af0a192ebad1de4
1
2
3
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
package com.nq.utils;
 
 
import java.util.Random;
 
 
public class KeyUtils {
    public static String getUniqueKey() {
        Random random = new Random();
        Integer number = Integer.valueOf(random.nextInt(900) + 100);
 
        return System.currentTimeMillis() + String.valueOf(number);
    }
 
 
    public static String getAgentUniqueKey() {
        Random random = new Random();
        Integer number = Integer.valueOf(random.nextInt(900000) + 100000);
        return PropertiesUtil.getProperty("agent.key.prefix") + String.valueOf(number);
    }
 
 
    public static String getFiveUnique() {
        Random random = new Random();
        Integer number = Integer.valueOf(random.nextInt(90000) + 10000);
        return String.valueOf(number);
    }
 
 
    public static String getRechargeOrderSn() {
        return "C" + getUniqueKey();
    }
 
 
    public static String getWithdrawOrderSn() {
        return "W" + getUniqueKey();
    }
 
 
    public static void main(String[] args) {
        String s1 = "A4058C23D071BF034EDA3E1181BC1EE8";
        String s2 = "A4058C23D071BF034EDA3E1181BC1EE8";
 
        System.out.println(s1.equals(s2));
 
 
        System.out.println(getUniqueKey());
        System.out.println(getAgentUniqueKey());
        System.out.println(getFiveUnique());
    }
}