internal 1.0.101__py3-none-any.whl → 1.0.102__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.

Potentially problematic release.


This version of internal might be problematic. Click here for more details.

internal/utils.py CHANGED
@@ -57,3 +57,22 @@ def get_current_utc() -> datetime:
57
57
 
58
58
  def get_lpr_data_list_redis_key(organization_id, plate_no):
59
59
  return f"{REDIS_LPR_DATA_LIST_PREFIX}_{organization_id}_{plate_no}"
60
+
61
+ async def mask_name(input_string: str, start_index: int = 1, mask_char: str = "o"):
62
+ """
63
+ 将姓名的前 start_index 个字符保留,其余字符替换为 'o',用于隐码处理。
64
+
65
+ :param input_string: 要隐码的姓名字符串
66
+ :param start_index: 从第几位开始进行隐码处理(默认值为 1)
67
+ :return: 隐码处理后的字符串
68
+ """
69
+ if not input_string:
70
+ return ""
71
+
72
+ # 保留前 start_index 个字符
73
+ visible_part = input_string[:start_index]
74
+
75
+ # 创建隐码部分,其余字符替换为 'o'
76
+ masked_part = mask_char * (len(input_string) - start_index)
77
+
78
+ return visible_part + masked_part
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.0.101
3
+ Version: 1.0.102
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -33,8 +33,8 @@ internal/middleware/log_request.py,sha256=bXAxmvvsYDhObXzfUw4ZNreKAWOo8ee_vpb6Xi
33
33
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  internal/model/base_model.py,sha256=NWjysNOp2MfXvAHGFqaQA_l8ZfTFvJbXQPUPuOXN_2g,5361
35
35
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
36
- internal/utils.py,sha256=zlppFkaZnvYGEZkNPmA_gMdlcZQrGaAOjpICl7QvRLg,1794
36
+ internal/utils.py,sha256=YDALmqhrZWIxOWaL8DeXhEJkn9hFfjh8gOdPcHTyQ5o,2455
37
37
  internal/validator_utils.py,sha256=5ZLcNIgw1hvkYOj1f6gS9AYxe7Y3ufW9FyDxUS7FsMQ,1226
38
- internal-1.0.101.dist-info/METADATA,sha256=9XvKnhkPDbbGLva1YOtTcIxey4bxznhw-dcFMNTslws,757
39
- internal-1.0.101.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
40
- internal-1.0.101.dist-info/RECORD,,
38
+ internal-1.0.102.dist-info/METADATA,sha256=CSAex7WqRmePll76Lig5IhkgrYBXlaGbgUhKSLDh9gM,757
39
+ internal-1.0.102.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
40
+ internal-1.0.102.dist-info/RECORD,,