From 11c3faddb0196f1ac9ff79a1d91619c9e33e0041 Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Sun, 19 Nov 2023 13:25:21 +0800 Subject: [PATCH] Use faster hash algorithum for thumbnail generation --- php/get.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/get.php b/php/get.php index 4b573d3..e322614 100644 --- a/php/get.php +++ b/php/get.php @@ -65,7 +65,8 @@ function create_thumbnail(string $category, string $file): string | null { $path = add_seperator_ab("/", $category, $file); $original_file = ROOT_DIR.IMG_DIR.$path; - $hash = hash_file("sha1", $original_file); + # use fast hashing algo, see: https://github.com/Cyan4973/xxHash + $hash = hash_file("xxh3", $original_file); $thumbnail_directory = ROOT_DIR.THUMBNAIL_DIR; $thumbnail_name = "$hash.jpg";