From ef5321bf8638eb7c74a6cd29cefa66f92689d187 Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Fri, 24 Jan 2025 08:08:40 -0800 Subject: [PATCH] Use md5 for unique hash. --- src/pymatgen/io/vasp/outputs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pymatgen/io/vasp/outputs.py b/src/pymatgen/io/vasp/outputs.py index aca673034de..3e7207564a8 100644 --- a/src/pymatgen/io/vasp/outputs.py +++ b/src/pymatgen/io/vasp/outputs.py @@ -2,6 +2,7 @@ from __future__ import annotations +import hashlib import itertools import math import os @@ -869,7 +870,7 @@ def get_computed_entry( if entry_id is None: calc_date = re.sub(" ", "", self.generator["DATE"]) calc_time = self.generator["TIME"] - hashed_structure = hash(str(self.final_structure)) + hashed_structure = hashlib.md5(str(self.final_structure).encode("utf-8")).hexdigest() # noqa: S324 entry_id = f"vasprun-{calc_date}-{calc_time}-{hashed_structure}" param_names = {