src/RijksregisternummerHelper.php
/**
   * Computes the check digits for an identification number of the National Register.
   *
   * @param string $birthday       The birthday in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
   * @param int    $sequenceNumber The sequence number.
   * @param int    $type
   *
   * @return string
   *
   * @since 1.0.0
   * @api
   */
Computes the check digits for an identification number of the National Register.
@param string $birthday       The birthday in [ISO 8601 format].
@param int    $sequenceNumber The sequence number.
@param int    $type

@return string


Computes the check digits for an identification number of the National Register . @param string $birthday The birthday in [ ISO 8601 format ] . @param int $sequenceNumber The sequence number . @param int $type @return string
public static function computeCheckDigits(string $birthday,
                                            int $sequenceNumber,
                                            int $type = self::TYPE_RIJKSREGISTERNUMMER): string
  {
    $year  = (int)substr($birthday, 0, 4);
    $month = (int)substr($birthday, 5, 2);
    $day   = (int)substr($birthday, 8, 2);
    $month = self::adjustMonth($month, $type);
    $number = $year % 100;
    $number = 100 * $number + $month;
    $number = 100 * $number + $day;
    if ($year>=2000)
    {
      $number += 2000000;
    }
    $number = 1000 * $number + $sequenceNumber;
    $check = 97 - $number % 97;
    return sprintf('%02d', $check);
  }
public static function computeCheckDigits ( string $ birthday , int $ sequenceNumber , int $ type = self :: TYPE_RIJKSREGISTERNUMMER ) : string { $ year = ( int ) substr ( $ birthday , 0 , 4 ) ; $ month = ( int ) substr ( $ birthday , 5 , 2 ) ; $ day = ( int ) substr ( $ birthday , 8 , 2 ) ; $ month = self :: adjustMonth ( $ month , $ type ) ; $ number = $ year % 100 ; $ number = 100 * $ number + $ month ; $ number = 100 * $ number + $ day ; if ( $ year >= 2000 ) { $ number += 2000000 ; } $ number = 1000 * $ number + $ sequenceNumber ; $ check = 97 - $ number % 97 ; return sprintf ( '%02d' , $ check ) ; }
Computes the check digits for an identification number of the National Register.
Computes the check digits for an identification number of the National Register .