src/Pdf.php
public function getCode128CheckNum($val)
    {
        $sum = 103;
        for ($i = 0; $i < strlen($val); $i++) {
            $sum += ($i + 1) * $this->ChrToC128(ord(substr($val, $i, 1)));
        }

        $ch_num = $sum % 103;

        return $ch_num;
    }
public function getCode128CheckNum($val)
    {
        $sum = 103;
        for ($i = 0; $i < strlen($val); $i++) {
            $sum += ($i + 1) * $this->ChrToC128(ord(substr($val, $i, 1)));
        }

        $ch_num = $sum % 103;

        return $ch_num;
    }
public function getCode128CheckNum ( $ val ) { $ sum = 103 ; for ( $ i = 0 ; $ i < strlen ( $ val ) ; $ i ++ ) { $ sum += ( $ i + 1 ) * $ this -> ChrToC128 ( ord ( substr ( $ val , $ i , 1 ) ) ) ; } $ ch_num = $ sum % 103 ; return $ ch_num ; }
helper method get Code 128.

@param string $val

@return int
helper method get Code 128 .