-
Notifications
You must be signed in to change notification settings - Fork 4
getIBANCheckDigits
elcapo edited this page Oct 16, 2014
·
3 revisions
getIBANCheckDigits
This function expects the entire account number in the electronic format (without spaces), as described in the ISO 13616-Compliant IBAN Formats document.
You can replace check digits with zeros when calling the function.
/* MySQL */
SELECT getIBANCheckDigits( 'GB00WEST12345698765432' ); /* Returns 82 */
/* JavaScript */
var CD = getIBANCheckDigits( 'GB00WEST12345698765432' ); /* CD = 82 */
/* PHP */
$CD = getIBANCheckDigits( 'GB00WEST12345698765432' ); /* $CD = ES03000G28667152 */
-
[string]
- Check digits corresponding to the received IBAN. -
[empty]
- Empty if the input string didn't fit the IBAN pattern.
In order to verify the first two digits of the input string, this function uses isSepaCountry
. In order to verify the length of the string, this function uses getAccountLength
. In order to properly run the algorithm that prepares the string and calculates the check digits, this function uses replaceLetterWithDigits
.
This function is part of the [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN)) package.
Go back home!
SEPA validations
- [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN))
Spanish validations
- NIF, NIE & CIF
- [Spanish Bank Accounts](Spanish Bank Accounts)
Helpers
- [Common functions](Common functions)