private function checkChecksum(&$content, $id, $realNameId, &$checksumAdded) {
        if ($this->identifiersAi[$realNameId][self::CHECKSUM]) {
            $nbCharContent = strlen($content);
            $minlengthContent = $this->identifiersAi[$realNameId][self::MINLENGTH];
            if ($nbCharContent === ($minlengthContent - 1)) {
                /* we need to calculate the checksum */
                $content .= self::getAiContentChecksum($content);
                $checksumAdded++;
            } elseif ($nbCharContent === $minlengthContent) {
                /* we need to check the checksum */
                $checksum = self::getAiContentChecksum(substr($content, 0, -1));
                if (intval($content[$nbCharContent - 1]) !== $checksum) {
                    throw new CINParseException('gs1128', 'The checksum of "(' . $id . ') ' . $content . '" must be: ' . $checksum);
                }
            }
        }

        return true;
    }
private function checkChecksum(&$content, $id, $realNameId, &$checksumAdded) {
        if ($this->identifiersAi[$realNameId][self::CHECKSUM]) {
            $nbCharContent = strlen($content);
            $minlengthContent = $this->identifiersAi[$realNameId][self::MINLENGTH];
            if ($nbCharContent === ($minlengthContent - 1)) {
                /* we need to calculate the checksum */
                $content .= self::getAiContentChecksum($content);
                $checksumAdded++;
            } elseif ($nbCharContent === $minlengthContent) {
                /* we need to check the checksum */
                $checksum = self::getAiContentChecksum(substr($content, 0, -1));
                if (intval($content[$nbCharContent - 1]) !== $checksum) {
                    throw new CINParseException('gs1128', 'The checksum of "(' . $id . ') ' . $content . '" must be: ' . $checksum);
                }
            }
        }

        return true;
    }
private function checkChecksum ( & $ content , $ id , $ realNameId , & $ checksumAdded ) { if ( $ this -> identifiersAi [ $ realNameId ] [ self :: CHECKSUM ] ) { $ nbCharContent = strlen ( $ content ) ; $ minlengthContent = $ this -> identifiersAi [ $ realNameId ] [ self :: MINLENGTH ] ; if ( $ nbCharContent === ( $ minlengthContent - 1 ) ) { /* we need to calculate the checksum */ $ content .= self :: getAiContentChecksum ( $ content ) ; $ checksumAdded ++ ; } elseif ( $ nbCharContent === $ minlengthContent ) { /* we need to check the checksum */ $ checksum = self :: getAiContentChecksum ( substr ( $ content , 0 , - 1 ) ) ; if ( intval ( $ content [ $ nbCharContent - 1 ] ) !== $ checksum ) { throw new CINParseException ( 'gs1128' , 'The checksum of "(' . $ id . ') ' . $ content . '" must be: ' . $ checksum ) ; } } } return true ; }
Verifies the checksum.

@param string $content
@param string $id
@param int $realNameId
@param int $checksumAdded
@return bool
Verifies the checksum .