コード例 #1
0
ファイル: CodigoControlV7.php プロジェクト: Vrian7ipx/repocas
 public static function appendVerhoeff($n, $c)
 {
     for (; $c > 0; $c--) {
         $n .= Verhoeff::get($n);
     }
     return $n;
 }
コード例 #2
0
ファイル: VerhoeffTest.php プロジェクト: afoozle/checkdigit
 /**
  * @dataProvider isValidCheckDigitProvider
  * @param $num string the number to validate
  * @param $expectedResult bool whether the provided number is valid or not
  */
 public function testIsValidCheckDigit($num, $expectedResult)
 {
     $algorithm = new Verhoeff();
     $this->assertEquals($expectedResult, $algorithm->isCheckDigitValid($num));
 }