getAlgorithm()->value . "\n"; echo "Hash: " . $hash->toString() . "\n"; echo "Hash Length: " . strlen($hash->toString()) . "\n\n"; // Test 2: HashAlgorithm::fast() echo "Test 2: HashAlgorithm::fast() method\n"; echo "-----------------------------------\n"; $fastAlgo = HashAlgorithm::fast(); echo "Fast Algorithm: " . $fastAlgo->value . "\n"; echo "Is xxh3 available: " . (HashAlgorithm::XXHASH3->isAvailable() ? 'Yes' : 'No') . "\n"; echo "Is xxh64 available: " . (HashAlgorithm::XXHASH64->isAvailable() ? 'Yes' : 'No') . "\n\n"; // Test 3: UserAgentParser mit Hash VO echo "Test 3: UserAgentParser using Hash VO\n"; echo "-----------------------------------\n"; $parser = new UserAgentParser(); $ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/120.0.0.0"; $parsed = $parser->parse($ua); echo "User-Agent: {$ua}\n"; echo "Browser: " . $parsed->browser->getDisplayName() . "\n"; echo "Browser Version: " . $parsed->browserVersion->toString() . "\n"; echo "Platform: " . $parsed->platform->getDisplayName() . "\n"; echo "Platform Version: " . $parsed->platformVersion->toString() . "\n"; echo "Engine: " . $parsed->engine->getDisplayName() . "\n"; echo "Is Modern: " . ($parsed->isModern ? 'Yes' : 'No') . "\n\n"; // Test 4: Hash comparison echo "Test 4: Hash equality check\n"; echo "-----------------------------------\n"; $hash1 = Hash::create("test data", HashAlgorithm::XXHASH3); $hash2 = Hash::create("test data", HashAlgorithm::XXHASH3); $hash3 = Hash::create("different data", HashAlgorithm::XXHASH3); echo "Hash1 equals Hash2: " . ($hash1->equals($hash2) ? 'Yes' : 'No') . "\n"; echo "Hash1 equals Hash3: " . ($hash1->equals($hash3) ? 'Yes' : 'No') . "\n\n"; // Test 5: Available hash algorithms echo "Test 5: Available hash algorithms\n"; echo "-----------------------------------\n"; foreach (HashAlgorithm::cases() as $algo) { $available = $algo->isAvailable() ? '✓' : '✗'; $secure = $algo->isSecure() ? '(secure)' : '(fast)'; echo "{$available} {$algo->value} - Length: {$algo->getLength()} chars {$secure}\n"; } echo "\n=== All Tests Completed Successfully ===\n";