From: Roland Häder Date: Thu, 23 Jan 2014 21:30:43 +0000 (+0000) Subject: md5() isn't really much better, but it needs to be fast, please help to find somethin... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=86d598813ff6b78315f466d57ff021939bdf4d1c;p=hub.git md5() isn't really much better, but it needs to be fast, please help to find something that works on 64-bit and 32-bit likewise. Thank you. --- diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 87404c7c5..fc55db710 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -306,8 +306,8 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __LINE__ . ']: content[md5]=' . md5($content) . ',sender=' . $this->getSessionId() . ',compressor=' . $this->getCompressorInstance()->getCompressorExtension()); // Create the hash - // @TODO crc32() is very weak, but it needs to be fast - $hash = crc32( + // @TODO md5() is very weak, but it needs to be fast + $hash = md5( $content . self::PACKAGE_CHECKSUM_SEPARATOR . $this->getSessionId() . @@ -380,8 +380,8 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __LINE__ . ']: content[md5]=' . md5($decodedContent[self::PACKAGE_CONTENT_MESSAGE]) . ',sender=' . $sessionId . ',compressor=' . $decodedContent[self::PACKAGE_CONTENT_EXTENSION]); // Create the hash - // @TODO crc32() is very weak, but it needs to be fast - $hash = crc32( + // @TODO md5() is very weak, but it needs to be fast + $hash = md5( $decodedContent[self::PACKAGE_CONTENT_MESSAGE] . self::PACKAGE_CHECKSUM_SEPARATOR . $sessionId .