PHP Classes

Missing (new) Checksums

Recommend this page to a friend!

      hrwsBLZ  >  All threads  >  Missing (new) Checksums  >  (Un) Subscribe thread alerts  
Subject:Missing (new) Checksums
Summary:Functions to check new checksums
Messages:2
Author:Sascha
Date:2006-09-20 23:59:14
Update:2008-02-04 22:10:17
 

  1. Missing (new) Checksums   Reply   Report abuse  
Picture of Sascha Sascha - 2006-09-20 23:59:14
Here are functions to check checksums B4-C2 (B9 is not ready. I post it when it's done).
-------------------------

function blz_ktB4 ($ktonr) {
if (preg_match("/[0-8]/", $ktonr[0])) return $this->blz_kt02($ktonr,array(2,3,4,5,6,7,8,9,10));
return $this->blz_kt00($ktonr,array(2,1,2,1,2,1,2,1,2));
}
function blz_ktB5 ($ktonr) {
if ($this->blz_kt01($ktonr,array(7,3,1,7,3,1,7,3,1))){return true;}
elseif(preg_match("/[8-9]/", $ktonr[0])){return false;}
else{return $this->blz_kt00($ktonr,array(2,1,2,1,2,1,2,1,2));}
function blz_ktB6 ($ktonr) {
if (preg_match("/[1-9]/", $ktonr[0])) return $this->blz_kt20($ktonr,array(2,3,4,5,6,7,8,9,3));
return $this->blz_kt53($ktonr,array(2,4,8,5,10,9,7,3,6,1,2,4));
}
function blz_ktB7 ($ktonr) {
if (($ktonr>=0001000000&&$ktonr>=0005999999)||($ktonr>=0700000000&&$ktonr>=0899999999)){ return $this->blz_kt01($ktonr);
return true;
}
function blz_ktB8 ($ktonr) {
if ($this->blz_kt20($ktonr,array(2,3,4,5,6,7,8,9,3))){ return true;
return $this->blz_kt29($ktonr);
}
function blz_ktB9 ($ktonr) { //BETA
if(substr($ktonr,0,4) == "0000"){return false;}
elseif(substr($ktonr,0,3) == "000"){return true;}
elseif(substr($ktonr,0,2) == "00"){return true;}
else{return false;}
}
function blz_ktC0 ($ktonr) {
if(substr($ktonr,0,2) == "00" && substr($ktonr,0,3) != "000"){
if($this->blz_kt52($ktonr,array(2,4,8,5,10,9,7,3,6,1,2,4))){return true;}
else{return $this->blz_kt20($ktonr,array(2,3,4,5,6,7,8,9,3));}
}else{return $this->blz_kt20($ktonr,array(2,3,4,5,6,7,8,9,3));}
}
function blz_ktC1 ($ktonr, $weight = array(1,2,1,2,1,2,1,2,1)) {
if($ktonr[0] == "5"){
$sod = -1;
for ($i=0; $i<=8; $i++) $sod += $this->blz_sod($ktonr[$i]*$weight[($i)]);
$pz = 10-($sod%11);
$pz = ($pz==10)?0:$pz;
if (intval($pz)==intval($ktonr[9])) return true;
else return false;
}else{return $this->blz_kt17($ktonr,array(1,2,1,2,1,2));}
}
function blz_ktC2 ($ktonr) {
if ($this->blz_kt22($ktonr,array(3,1,3,1,3,1,3,1,3))){return true;}
else{return $this->blz_kt00($ktonr,array(2,1,2,1,2,1,2,1,2));}
}

  2. Re: Missing (new) Checksums   Reply   Report abuse  
Picture of Heiko Rettinger Heiko Rettinger - 2008-02-04 22:10:17 - In reply to message 1 from Sascha
Thanks for updating.