From 0aa822c5e4dbb6261e9fa12aec0c328d336b7a74 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 21 Apr 2023 01:13:15 -0700 Subject: [PATCH] binext: use CRC for getTimeBin Academic only, the performance difference between these is zero Signed-off-by: Varun Patil --- lib/Service/BinExt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Service/BinExt.php b/lib/Service/BinExt.php index ecd973bd..adde550e 100644 --- a/lib/Service/BinExt.php +++ b/lib/Service/BinExt.php @@ -14,8 +14,8 @@ class BinExt /** Copy a binary to temp dir for execution */ public static function getTempBin(string $path, string $name, bool $copy = true): string { - // Hash the path to provide a suffix using md5, 8 characters - $suffix = substr(md5($path), 0, 8); + // Bust cache if the path changes + $suffix = hash('crc32', $path); // Check target temp file $target = sys_get_temp_dir().'/'.$name.'-'.$suffix;