Browse Source

添加uuid5方法

dongzhaorui 1 year ago
parent
commit
c2648f8bdc
1 changed files with 6 additions and 0 deletions
  1. 6 0
      FworkSpider/feapder/utils/tools.py

+ 6 - 0
FworkSpider/feapder/utils/tools.py

@@ -1801,6 +1801,12 @@ def get_uuid(key1="", key2=""):
     return str(uuid_object)
 
 
+def get_uuid5():
+    namespace = uuid.NAMESPACE_OID
+    name = str(int(time.time() * 1000000000))
+    return str(uuid.uuid5(namespace, name)).replace('-', '')
+
+
 def get_hash(text):
     return hash(text)