]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/package/class_NetworkPackage.php
New singleton-factories introduced:
[hub.git] / application / hub / main / package / class_NetworkPackage.php
index 9a4ce15df1299ad6ad4c3ec5ec91a52ea0435269..192403e65a5f7eec40af8bbb988930cd2364fa8d 100644 (file)
@@ -51,6 +51,11 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva
         */
        const PACKAGE_MASK_SEPERATOR = ':';
 
+       /**
+        * Seperator for checksum
+        */
+       const PACKAGE_CHECKSUM_SEPERATOR = ':';
+
        /**
         * Array indexes for above mask, start with zero
         */
@@ -152,15 +157,16 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva
         * @param       $helperInstance         An instance of a BaseHubHelper class
         * @param       $nodeInstance           An instance of a NodeHelper class
         * @return      $hash   Hash for given package content
+        * @todo        $helperInstance is unused
         */
        private function getHashFromContent ($content, BaseHubHelper $helperInstance, NodeHelper $nodeInstance) {
                // Create the hash
-               // @TODO crc32 is not good, but it needs to be fast
+               // @TODO crc32 is not very strong, but it needs to be fast
                $hash = crc32(
                        $content .
-                       ':' .
+                       self::PACKAGE_CHECKSUM_SEPERATOR .
                        $nodeInstance->getSessionId() .
-                       ':' .
+                       self::PACKAGE_CHECKSUM_SEPERATOR .
                        $this->getCompressorInstance()->getCompressorExtension()
                );