Platinum Partner

Generare CNP

// Generare CNP


 2000 && !$rezident && !$strain)  $sex = $sex + 4; 
        //daca este rezident 
        if ($rezident) $sex = $sex+6;
        $luna=rand(1,12);
        $zi = rand(1,31);
        //daca este un copil care s-a nascut anul acesta atunci avem grija ca data generata sa nu fie mai mare decat data de azi
        if ($an == date('Y')) { 
            $luna = rand(1,date('m'));
            $ziua = rand(1,date('d'));
        }

        $date = new DateTime($an.'-'.$luna.'-'.$zi);
        
        $judet=rand(1,52);
        $judet=($judet<10) ? '0'.$judet : $judet;
        $control = rand(1,999);
        if ($control<10) { 
            $control='00'.$control; 
        }
        else if ($control<100) {
            $control='0'.$control;
        }
        $cnp =  $sex . $date->format("ymd") . $judet.$control;
        $suma=0;
        for($i=0;$i<=11;$i++) {
            $suma+=$sirCiudat[$i]*$cnp[$i];
        }
        $rest = $suma%11;
        $cifraControl = ($rest==10) ? 1 : $rest;
        $cnp.=$cifraControl;
        if (strlen($cnp)!=13 ) {
             return $errorMsg;
        }
        
        else return $cnp;
        
    }


    for($i=0;$i<100;$i++) {
    echo generareCnp(rand(1,2),rand(0,209))."\n";
    }
    
?>
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}