+ $chunk = $this->getStackerInstance()->popNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP);
+
+ // Split the string with proper separator character
+ $chunkSplits = explode(PackageFragmenter::CHUNK_DATA_HASH_SEPARATOR, $chunk);
+
+ /*
+ * Make sure three elements are always found:
+ * 0 = Hash
+ * 1 = Serial number
+ * 2 = Raw data
+ */
+ assert(count($chunkSplits) == 3);
+
+ // Now hash the raw data again
+ $chunkHash = $this->getCryptoInstance()->hashString($chunkSplits[2], $chunkSplits[0], false);
+
+ // Debug output
+ /* NOISY-DEBUG: */ $this->debugOutput('CHUNK-HANDLER: chunkHash=' . $chunkHash . ',chunkSplits[0]=' . $chunkSplits[0] . ',chunkSplits[1]=' . $chunkSplits[1]);
+
+ // Is it the same?
+ if ($chunkSplits[0] != $chunkHash) {
+ // Re-request this chunk (trust the hash in index # 0)
+ $this->rerequestChunkBySplitsArray($chunkSplits);
+
+ // Don't process this chunk
+ return;
+ } // END - if