From 116f7268854abe0e2649ae735b3a0df50be38d35 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 18 Nov 2023 16:57:30 +1100 Subject: [PATCH] Fix helpers checking for wtime existance --- app/helpers.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers.php b/app/helpers.php index bd3251d..4c44878 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -11,11 +11,13 @@ if (! function_exists('crc16')) { function crc16($data): int { $crc = 0x0000; + for ($i = 0; $i < strlen($data); $i++) { $x = (($crc >> 8) ^ ord($data[$i])) & 0xFF; $x ^= $x >> 4; $crc = (($crc << 8) ^ ($x << 12) ^ ($x << 5) ^ $x) & 0xFFFF; } + return $crc; } } @@ -121,7 +123,7 @@ if (! function_exists('timew')) { } } -if (! function_exists('dwtime')) { +if (! function_exists('wtime')) { /** * Convert a 40 bit integer into a time. * @see timew()