You are here

private static function IbanValidator::toBigInt in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Constraints/IbanValidator.php \Symfony\Component\Validator\Constraints\IbanValidator::toBigInt()
1 call to IbanValidator::toBigInt()
IbanValidator::validate in vendor/symfony/validator/Constraints/IbanValidator.php
Checks if the passed value is valid.

File

vendor/symfony/validator/Constraints/IbanValidator.php, line 263

Class

IbanValidator
@author Manuel Reinhard <manu@sprain.ch> @author Michael Schummel @author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Constraints

Code

private static function toBigInt($string) {
  $chars = str_split($string);
  $bigInt = '';
  foreach ($chars as $char) {

    // Convert uppercase characters to ordinals, starting with 10 for "A"
    if (ctype_upper($char)) {
      $bigInt .= ord($char) - 55;
      continue;
    }

    // Simply append digits
    $bigInt .= $char;
  }
  return $bigInt;
}