Fix security warning: use sha256 instead of md5 (#22373)

### Description

Fix S360 warning: Use of unapproved hash algorithm or API MD5.
This commit is contained in:
Tianlei Wu 2024-10-09 17:24:46 -07:00 committed by GitHub
parent 5cc2529379
commit 2b0ea6c834
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -117,7 +117,7 @@ class EngineBuilder:
model_name = model_name + "_" + "_".join(self.pipeline_info.controlnet)
if hash_source:
model_name += "_" + hashlib.md5("\t".join(hash_source).encode("utf-8")).hexdigest()[:8]
model_name += "_" + hashlib.sha256("\t".join(hash_source).encode("utf-8")).hexdigest()[:8]
# TODO: When we support original VAE, we shall save custom VAE to another directory.