From 65fd23cf67ddb086cfa5678e2a5c88590e4db23f Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Mon, 13 Apr 2020 22:44:55 -0400 Subject: [PATCH] Replace MD5 hash with UUID4 --- diagrams/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diagrams/__init__.py b/diagrams/__init__.py index 9626ea6d..a8c3da93 100644 --- a/diagrams/__init__.py +++ b/diagrams/__init__.py @@ -1,6 +1,6 @@ import contextvars import os -from hashlib import md5 +import uuid from pathlib import Path from random import getrandbits from typing import List, Union, Dict @@ -387,7 +387,7 @@ class Node: @staticmethod def _rand_hash(): - return md5(getrandbits(64).to_bytes(64, "big")).hexdigest() + return uuid.uuid4().hex def _load_icon(self): basedir = Path(os.path.abspath(os.path.dirname(__file__)))