Skip to content

getGlobalIdentifier

Carlos Capote edited this page Nov 4, 2015 · 9 revisions

This "global identifier" refers to the code AT-02 created for the C19.14. The C19.14 is a temporary file format to be used in Spain until the ISO 20022 XML format is finally adopted.

If the IBAN is built by adding a few digits to the national bank accounts, the AT-02 is build by adding digits to the national identifier. In the case of Spain, this identifiers are NIFs, NIEs and CIFs.

For instance, the Spanish CIF G28667152, can be expressed internationally as ES55000G28667152.

Usage

/* MySQL */
SELECT getGlobalIdentifier(
           'G28667152',
           'ES',
           '' ); /* Returns ES55000G28667152 */
/* JavaScript */
var globalId = getGlobalIdentifier(
                   'G28667152',
                   'ES',
                   '' ); /* globalId = ES55000G28667152 */
/* PHP */
$globalId = getGlobalIdentifier(
                'G28667152',
                'ES',
                '' ); /* $globalId = ES55000G28667152 */

Return values

  • [string] - International version of the identification number.

Dependencies

In order to properly run the algorithm that prepares the string and calculates the check digits, this function uses replaceLetterWithDigits and replaceCharactersNotInPattern.

Category

This function is part of the [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN)) package.

SEPA validations

  • [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN))

Spanish validations

Helpers

  • [Common functions](Common functions)
Clone this wiki locally