Sign in Join
Wiki copytemporary

ISO 7064

English · Français

Overview

ISO 7064 specifies a set of check character systems capable of protecting strings against errors which occur when people copy or key data.

The check character systems specified in ISO/IEC 7064:2002 can detect:

Function StrMOD97

The function StrMOD97 can encode and verify a check character (an added character which may be used to verify the accuracy of the string by a mathematical relationship to that string) and a supplementary check character (a character which does not belong to the character set of the strings which are to be protected) in accordance with ISO 7064, MOD 97-10 for numeric strings with two check digits.

pascal
function StrMOD97(s: String): integer;
// Pre-condition: s can only contain digits, otherwise this function will raise an exception.
// See https://wiki.freepascal.org/International_Bank_Account_Number for handling non digits
const
  modu = 97;
var
  sx: String;
  isx, ic, p: Integer;
begin
   p := Length( s );
   while ( p > 9 ) do
     begin
       sx := Copy( s, 1, 9 );
       Delete( s, 1, 9 );
       isx := StrToInt( sx );
       ic := isx mod modu;
       s := IntToStr( ic ) + s;
       p := Length( s );
     end;
   isx := StrToInt( s );
   if isx >= modu
     then ic := isx mod modu
     else ic := isx;
  result := ic;
end;

All ISO 7064 check character systems

Pure system algorithms

Pure system algorithms use a single modulus for all stages of the computation.

Hybrid system algorithms

Hybrid system algorithms use two moduli in the computation. One modulus is equal to, and other other is greater than, the number of characters in the characters set of the string being protected. They always produce a single check character within the character set of the string to be protected.

Usage

The ISO/IEC 7064 standard has multiple applications including International Bank Account Numbers, International Standard Name Identifiers (ISNI), ORCID IDs and VAT identification numbers of several countries.

See also


From the Free Pascal wiki, page "ISO 7064", as it stood on 2021-12-04 after a change by Jwdietrich, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.