binext: use CRC for getTimeBin

Academic only, the performance difference between these is zero

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/602/head
Varun Patil 2023-04-21 01:13:15 -07:00
parent f833ddaac8
commit 0aa822c5e4
1 changed files with 2 additions and 2 deletions

View File

@ -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;