We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98e9496 commit 45a3f02Copy full SHA for 45a3f02
1 file changed
WangZhou/0001/gen_act_key.py
@@ -0,0 +1,21 @@
1
+import uuid
2
+
3
4
+def gen_act_key(n):
5
+ """
6
+ 生成 n 个激活码,保存在字典。
7
+ :param n: int
8
+ :return: dict
9
10
+ act_code_store = {}
11
12
+ for i in range(n):
13
+ code0 = str(uuid.uuid1()).split('-')[0]
14
+ code1 = '-'.join(str(uuid.uuid3(uuid.NAMESPACE_DNS, f'{i}')).split('-')[1:])
15
+ act_code = code0 + '-' + code1
16
+ act_code_store[f'id-{i}'] = act_code
17
+ return act_code_store
18
19
20
+if __name__ == "__main__":
21
+ activity_code = gen_act_key(200)
0 commit comments