Skip to content

Commit 2fbc68a

Browse files
only use xxh64 is on php 8.1 or higher
1 parent ba71e9f commit 2fbc68a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/collect-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function determine_uniqueness_fingerprint(string $type, $thing): array
279279
$seed_value = \file_get_contents(get_upload_dir() . '/sessions/.daily_seed');
280280
$user_agent = $_SERVER['HTTP_USER_AGENT'];
281281
$ip_address = get_client_ip();
282-
$visitor_id = \hash("xxh64", "{$seed_value}-{$user_agent}-{$ip_address}", false);
282+
$visitor_id = \hash(PHP_VERSION_ID >= 80100 ? "xxh64" : "sha1", "{$seed_value}-{$user_agent}-{$ip_address}", false);
283283
$session_file = get_upload_dir() . "/sessions/{$visitor_id}";
284284
$time_midnight = (new \DateTimeImmutable('today, midnight', get_site_timezone()))->getTimestamp();
285285
$things = [];

0 commit comments

Comments
 (0)