+ /**
+ * Checks whether the hash generated from package content is the same ("valid") as given
+ *
+ * @param $chunkSplits An array from a splitted chunk
+ * @return $isValid Whether the hash is "valid"
+ */
+ private function isChunkHashValid (array $chunkSplits) {
+ // 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]);
+
+ // Check it
+ $isValid = ($chunkSplits[0] === $chunkHash);
+
+ // ... and return it
+ return $isValid;
+ }
+
+ /**
+ * Checks whether the given serial number is valid
+ *
+ * @param $serialNumber A serial number from a chunk
+ * @return $isValid Whether the serial number is valid
+ */
+ private function isSerialNumberValid ($serialNumber) {
+ // Check it
+ $isValid = ((strlen($serialNumber) == PackageFragmenter::MAX_SERIAL_LENGTH) && ($this->bigintval($serialNumber, false) === $serialNumber));
+
+ // Return result
+ return $isValid;
+ }
+