private static function crc16(string $hexChars): int
    {
        $chars = hex2bin($hexChars);
        if ($chars) {
            $crc = 0x1D0F;
            for ($i = 0; $i < strlen($chars); $i++) {
                $x = ($crc >> 8) ^ ord($chars[$i]);
                $x ^= $x >> 4;
                $crc = (($crc << 8) ^ ($x << 12) ^ ($x << 5) ^ ($x)) & 0xFFFF;
            }
        } else {
            $crc = 0;
        }
        return $crc;
    }