From 4d4093356b357d329e225f68c8874481b8197e67 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Mon, 7 Apr 2025 14:58:19 +0800 Subject: [PATCH] Use sha256 intead of md5 --- src/spring/azext_spring/migration/converter/base_converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spring/azext_spring/migration/converter/base_converter.py b/src/spring/azext_spring/migration/converter/base_converter.py index ff3f662d6e0..0ac933d7340 100644 --- a/src/spring/azext_spring/migration/converter/base_converter.py +++ b/src/spring/azext_spring/migration/converter/base_converter.py @@ -116,7 +116,7 @@ def _get_storage_unique_name(self, disk_props): mount_path = self._get_storage_mount_path(disk_props) access_mode = self._get_storage_access_mode(disk_props) storage_unique_name = f"{storage_name}|{account_name}|{share_name}|{mount_path}|{access_mode}" - hash_value = hashlib.md5(storage_unique_name.encode()).hexdigest()[:16] # Take first 16 chars of hash + hash_value = hashlib.sha256(storage_unique_name.encode()).hexdigest()[:16] # Take first 16 chars of hash result = f"{storage_name}{hash_value}".replace("-", "").replace("_", "") return result[:32] # Ensure total length is no more than 32