Example #1
0
 public static function appendVerhoeff($n, $c)
 {
     for (; $c > 0; $c--) {
         $n .= Verhoeff::get($n);
     }
     return $n;
 }
Example #2
0
 /**
  * @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));
 }