xtn-tools-pro 1.0.1.3.5__py3-none-any.whl → 1.0.1.3.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xtn_tools_pro/utils/g_random.py +39 -0
- {xtn_tools_pro-1.0.1.3.5.dist-info → xtn_tools_pro-1.0.1.3.6.dist-info}/METADATA +1 -1
- {xtn_tools_pro-1.0.1.3.5.dist-info → xtn_tools_pro-1.0.1.3.6.dist-info}/RECORD +7 -6
- {xtn_tools_pro-1.0.1.3.5.dist-info → xtn_tools_pro-1.0.1.3.6.dist-info}/LICENSE +0 -0
- {xtn_tools_pro-1.0.1.3.5.dist-info → xtn_tools_pro-1.0.1.3.6.dist-info}/WHEEL +0 -0
- {xtn_tools_pro-1.0.1.3.5.dist-info → xtn_tools_pro-1.0.1.3.6.dist-info}/entry_points.txt +0 -0
- {xtn_tools_pro-1.0.1.3.5.dist-info → xtn_tools_pro-1.0.1.3.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 随机生成
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/8/12 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
11
|
+
import random
|
12
|
+
from datetime import datetime
|
13
|
+
|
14
|
+
|
15
|
+
def g_random_port(s=49152, e=65535):
|
16
|
+
"""
|
17
|
+
随机生成端口
|
18
|
+
:param s:范围开始(包含)
|
19
|
+
:param e:范围结束(包含)
|
20
|
+
:return:
|
21
|
+
"""
|
22
|
+
num = random.randint(s, e)
|
23
|
+
return num
|
24
|
+
|
25
|
+
|
26
|
+
def g_random_orderId(prefix="", suffix=""):
|
27
|
+
"""
|
28
|
+
随机生成20位订单号,前部分由年月日时分秒组成
|
29
|
+
:param prefix: 自定义前缀
|
30
|
+
:param suffix: 自定义后缀
|
31
|
+
:return:
|
32
|
+
"""
|
33
|
+
current_time = datetime.now()
|
34
|
+
date_time_str = current_time.strftime("%y%m%d%H%M%S")
|
35
|
+
# 生成随机部分
|
36
|
+
random_number = ''.join(random.choices('0123456789', k=8))
|
37
|
+
# 组合成完整的数字
|
38
|
+
combined_number = int(date_time_str + random_number)
|
39
|
+
return f"{prefix}{combined_number}{suffix}"
|
@@ -57,6 +57,7 @@ xtn_tools_pro/utils/audio_video.py,sha256=3Im3tGOW6IbmqDcrE1SJUg6eGyLGEyq11Qu6TC
|
|
57
57
|
xtn_tools_pro/utils/crypto.py,sha256=B6NC2yVxtwrbSZnngudTFRm7YRGKKEusydVVYWwxFHs,5231
|
58
58
|
xtn_tools_pro/utils/crypto_pro.py,sha256=KkTX8ITfawzKEdRw6Oq96ubnGMJrVJag-50JMheXY9c,5608
|
59
59
|
xtn_tools_pro/utils/file_utils.py,sha256=vsUgds8I8Z2pL9a4oCv1q0JrZsDP29qLyLyGVqj5sX8,3311
|
60
|
+
xtn_tools_pro/utils/g_random.py,sha256=wpAniSpVDV55Uqq6XzXvBaA14MWprC6fDeUOnhrqRcQ,1216
|
60
61
|
xtn_tools_pro/utils/helpers.py,sha256=0CTMY7wfSQR_DC9-v1lkKQLpWcB1FL9V_kw_5DOcZ40,4454
|
61
62
|
xtn_tools_pro/utils/log.py,sha256=MPT9q1keNYroaw6U9a-Gc0iT0ceUEVTI-Tz2GEiWLUc,11038
|
62
63
|
xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,1657
|
@@ -65,9 +66,9 @@ xtn_tools_pro/utils/shell.py,sha256=s6sJedxLLQokcI1hF5YSD3qgGUPK0brNcP-D3-yv54I,
|
|
65
66
|
xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
|
66
67
|
xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
|
67
68
|
xtn_tools_pro/utils/win.py,sha256=D5_58WMKOGe9ZwJuJr2JGAWmVISwMOZUx4t7wXUCviU,3512
|
68
|
-
xtn_tools_pro-1.0.1.3.
|
69
|
-
xtn_tools_pro-1.0.1.3.
|
70
|
-
xtn_tools_pro-1.0.1.3.
|
71
|
-
xtn_tools_pro-1.0.1.3.
|
72
|
-
xtn_tools_pro-1.0.1.3.
|
73
|
-
xtn_tools_pro-1.0.1.3.
|
69
|
+
xtn_tools_pro-1.0.1.3.6.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
70
|
+
xtn_tools_pro-1.0.1.3.6.dist-info/METADATA,sha256=TjXtKgOapU6AFTrJAUloYTnIwBGmsomCzjOfpxr060A,597
|
71
|
+
xtn_tools_pro-1.0.1.3.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
72
|
+
xtn_tools_pro-1.0.1.3.6.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
|
73
|
+
xtn_tools_pro-1.0.1.3.6.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
|
74
|
+
xtn_tools_pro-1.0.1.3.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|