From f50976992c3d80aeff61e5b0b41944536e7bb8d9 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Wed, 13 Dec 2023 12:21:14 +0300 Subject: [PATCH] =?UTF-8?q?fix(sec-md5):=20=F0=9F=90=9E=20md5=20security?= =?UTF-8?q?=20warning=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- supervision/assets/downloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervision/assets/downloader.py b/supervision/assets/downloader.py index 9b12264a..fd5b7927 100644 --- a/supervision/assets/downloader.py +++ b/supervision/assets/downloader.py @@ -1,5 +1,5 @@ import os -from hashlib import md5 +from hashlib import new as hash_new from pathlib import Path from shutil import copyfileobj from typing import Union @@ -35,7 +35,7 @@ def is_md5_hash_matching(filename: str, original_md5_hash: str) -> bool: with open(filename, "rb") as file: file_contents = file.read() - computed_md5_hash = md5(file_contents).hexdigest() + computed_md5_hash = hash_new(file_contents, name="MD5").hexdigest() return computed_md5_hash == original_md5_hash