src/Barcode/S25.php
private function checksum($code)
	{
		$len = strlen($code);
		$sum = 0;
		for ($i = 0; $i < $len; $i += 2) {
			$sum += $code[$i];
		}
		$sum *= 3;
		for ($i = 1; $i < $len; $i += 2) {
			$sum += ($code[$i]);
		}
		$r = $sum % 10;
		if ($r > 0) {
			$r = (10 - $r);
		}
		return $r;
	}
private function checksum($code)
	{
		$len = strlen($code);
		$sum = 0;
		for ($i = 0; $i < $len; $i += 2) {
			$sum += $code[$i];
		}
		$sum *= 3;
		for ($i = 1; $i < $len; $i += 2) {
			$sum += ($code[$i]);
		}
		$r = $sum % 10;
		if ($r > 0) {
			$r = (10 - $r);
		}
		return $r;
	}
private function checksum ( $ code ) { $ len = strlen ( $ code ) ; $ sum = 0 ; for ( $ i = 0 ; $ i < $ len ; $ i += 2 ) { $ sum += $ code [ $ i ] ; } $ sum *= 3 ; for ( $ i = 1 ; $ i < $ len ; $ i += 2 ) { $ sum += ( $ code [ $ i ] ) ; } $ r = $ sum % 10 ; if ( $ r > 0 ) { $ r = ( 10 - $ r ) ; } return $ r ; }
Checksum for standard 2 of 5 barcodes.

@param string $code

@return int
Checksum for standard 2 of 5 barcodes .