svn: /pear/packages/Validate/trunk/Validate/ IR.php

From: Date: Fri, 18 Mar 2011 22:27:09 +0000
Subject: svn: /pear/packages/Validate/trunk/Validate/ IR.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-61470@lists.php.net to get a copy of this message
arash Fri, 18 Mar 2011 22:27:09 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309410 Log: Validate_IR, added detailed comment on ssn. Changed paths: U pear/packages/Validate/trunk/Validate/IR.php Modified: pear/packages/Validate/trunk/Validate/IR.php =================================================================== --- pear/packages/Validate/trunk/Validate/IR.php 2011-03-18 22:26:38 UTC (rev 309409) +++ pear/packages/Validate/trunk/Validate/IR.php 2011-03-18 22:27:09 UTC (rev 309410) @@ -107,7 +107,14 @@ } /** - * Checks social security numbers for Iran called "kode melli" + * Checks social security numbers for Iran called "kode melli". + * kode melli's last digit from left is the check digit, here is the algorithm: + * A= last digit from left + * B= (first digit*10) + (2th digit*9) + ... (9th digit *2) + * C= B – (B/11)*11 + * if C==0 and A==0 OK + * if C==1 and A==1 OK + * if C>1 and A==(C-11) OK * * @param string $check The value to check. *

« previous php.pear.cvs (#61470) next »