src/Method/Native/TarExtractor.php
protected function calculateChecksum($headerBlock)
    {
        $checksum = 0;
        for ($i = 0; $i<self::SIZE_HEADER_BLOCK; $i++) {
            if ($i < 148 || $i >= 156) {
                $checksum += ord($headerBlock[$i]);
            } else {
                $checksum += 32;
            }
        }

        return $checksum;
    }
protected function calculateChecksum($headerBlock)
    {
        $checksum = 0;
        for ($i = 0; $i<self::SIZE_HEADER_BLOCK; $i++) {
            if ($i < 148 || $i >= 156) {
                $checksum += ord($headerBlock[$i]);
            } else {
                $checksum += 32;
            }
        }

        return $checksum;
    }
protected function calculateChecksum ( $ headerBlock ) { $ checksum = 0 ; for ( $ i = 0 ; $ i < self :: SIZE_HEADER_BLOCK ; $ i ++ ) { if ( $ i < 148 || $ i >= 156 ) { $ checksum += ord ( $ headerBlock [ $ i ] ) ; } else { $ checksum += 32 ; } } return $ checksum ; }
Calculates the checksum of the header block.

The checksum is calculated by taking the sum of the unsigned byte values of the header
record with the eight checksum bytes taken to be ascii spaces (decimal value 32).

@param string $headerBlock

@return int
Calculates the checksum of the header block .