fixing insecure hash function

pull/3905/head
Maruyama_Aya 2023-06-06 14:51:11 +08:00
parent b56c7f4283
commit 1c1f71cbd2
1 changed files with 1 additions and 1 deletions

View File

@ -397,7 +397,7 @@ def main(args):
images = pipeline(example["prompt"]).images images = pipeline(example["prompt"]).images
for i, image in enumerate(images): for i, image in enumerate(images):
hash_image = hashlib.sha1(image.tobytes()).hexdigest() hash_image = hashlib.sha256(image.tobytes()).hexdigest()
image_filename = class_images_dir / f"{example['index'][i] + cur_class_images}-{hash_image}.jpg" image_filename = class_images_dir / f"{example['index'][i] + cur_class_images}-{hash_image}.jpg"
image.save(image_filename) image.save(image_filename)