PHP Classes
elePHPant
Icontem

ISO 7064 Mod 97 10: Encode and verify checksum with ISO 7064 mod 97 10

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2011-12-19 (3 years ago) RSS 2.0 feedNot enough user ratingsTotal: 345 All time: 6,451 This week: 1,164Up
Version License PHP version Categories  
iso-7064-mod-97-10 1.0.0GNU General Publi...5.0Algorithms, PHP 5, Finances
Description Author  

This class can encode and verify number checksum with ISO 7064 mod 97 10 .

It can take a string with digits and computes the respective mod 97 checksum according to ISO 7064 standard used in financial transactions.

The class can also take a number that includes the checksum and verify if it is correct.

Picture of Steven Koch
Name: Steven Koch <contact>
Classes: 1 package by
Country: Portugal Portugal
Age: ???
All time rank: 337340 in Portugal Portugal
Week rank: 1592 Up20 in Portugal Portugal Up

Details provided by the author  
Description
===========

Algoritmo que calcula numero de controle, descrito em ISO 7064, Mod 97 10. Normalmente usado para validar IBAN e NIBs de contas bancárias.


Methods
=======

class ISO7064Mod97_10
    - encode( string/integer $input )
        return checksum number
    - verify( string/integer $input )
        verify if input are valid with your check digits
    - checkCode( string/integer $input )
        return only check digits of input
    - computeCheck( string/integer $input )
        return mod 97 of input
    - getCheck( string/integer $input )
        return only chek digits of input
    - getData( string/integer $input )
        return value of input without check digits

Example
=======

require 'ISO7064Mod97_10.php'
$c = new ISO7064Mod97_10();
$n = 107571;
$yourNum = $c->encode($n);
var_dump($yourNum);
//int(10757107)
var_dump($c->verify($yourNum));
$validNumber = '10757107';
$invalidNumber = '10767107';
var_dump($c->verify($validNumber));
var_dump($c->verify($invalidNumber));


Qualquer dúvida entre em contacto <stvkoch at gmail.com> Steven Koch
  Files folder image Files  
File Role Description
Plain text file ISO7064Mod97_10.php Class Class source
Accessible without login Plain text file README Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%Total:345All time:6,451
 This week:0This week:1,164Up