Last active
April 18, 2024 19:39
Revisions
-
bsesic revised this gist
Apr 18, 2024 . No changes.There are no files selected for viewing
-
bsesic renamed this gist
Mar 13, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ def generate_hash_UUID(name): """ Generate a UUID based on the hashed string Args: name (str): Name of the entity. -
bsesic renamed this gist
Mar 13, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bsesic created this gist
Mar 13, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ def generate_hash_from_UUID(name): """ Generate a UUID based on the hashed string Args: name (str): Name of the entity. Returns: str: UUID of the entity. """ # Hash the string using a hashing algorithm (e.g., SHA-256) hashed_string = hashlib.sha256(name.encode()).hexdigest() # Generate a UUID based on the hashed string uuid_from_hash = uuid.uuid5(uuid.NAMESPACE_OID, hashed_string) return uuid_from_hash