Autor: Marcel Felipe | Publicado: 2012-03-19T18:19:00-07:00










Gerador de CPF e CNPJ Válidos






























  <!--

  body { background: #404040; margin: 30px; padding: 0; border: 0; text-align: center; }

  #geral { color: #ffffff; margin: auto; width: 468px; text-align: left; }

  #cabecalho h1 a { color: #f1f1f1; display: block; font: 70% trebuchet ms, sans-serif; text-align: center; }

  #resultado { text-align: center; }

  #resultado input { color: #000000; font: 110% trebuchet ms; text-align: center; margin: 10px; border: 3px #c0c0c0 solid; width: 400px; }

  #pontuacao { font: 80% trebuchet ms; margin-bottom: 10px; }

  #cpfcnpj { font: 80% trebuchet ms; margin-bottom: 10px; }

  #botao { text-align: center; }

  #botao input { font: 80% trebuchet ms; margin-bottom: 10px; width: 200px; }

  #rodape { background: #505050; font: 60% helvetica, verdana, sans-serif; text-align: center; padding: 10px; }

  #rodape a { color: #cccccc; }

  #rodape p { color: #cccccc; margin: 0; }

  #sobre { clear: both; }

  #sobre h2 { color: #f1f1f1; font: 90% verdana, trebuchet ms, sans-serif; font-weight: bold; text-align: left; }

  #sobre h3 { color: #f1f1f1; font: 70% verdana, trebuchet ms, sans-serif; font-weight: bold; text-align: left; padding: 10px 0 0 10px; margin: 0; }

  #sobre p { color: #f1f1f1; font: 70% verdana, trebuchet ms, sans-serif; text-align: left; padding: 2px 0 0 20px; margin: 0; }

  .direita { clear: both; float: right; margin: 0; padding: 0; }

  .direita a img {  border: 0; }

  -->

  





   var comPontos;



   function randomiza(n) {

 var ranNum = Math.round(Math.random()*n);

 return ranNum;

   }



   function mod(dividendo,divisor) {

 return Math.round(dividendo - (Math.floor(dividendo/divisor)*divisor));

   }

   

   function cpf() {

 var n = 9;

 var n1 = randomiza(n);

 var n2 = randomiza(n);

 var n3 = randomiza(n);

 var n4 = randomiza(n);

 var n5 = randomiza(n);

 var n6 = randomiza(n);

 var n7 = randomiza(n);

 var n8 = randomiza(n);

 var n9 = randomiza(n);

 var d1 = n9*2+n8*3+n7*4+n6*5+n5*6+n4*7+n3*8+n2*9+n1*10;

 d1 = 11 - ( mod(d1,11) );

 if (d1>=10) d1 = 0;

 var d2 = d1*2+n9*3+n8*4+n7*5+n6*6+n5*7+n4*8+n3*9+n2*10+n1*11;

 d2 = 11 - ( mod(d2,11) );

 if (d2>=10) d2 = 0;

 retorno = '';

 if (comPontos) retorno = ''+n1+n2+n3+'.'+n4+n5+n6+'.'+n7+n8+n9+'-'+d1+d2;

 else retorno = ''+n1+n2+n3+n4+n5+n6+n7+n8+n9+d1+d2;

 return retorno;

   }



   function cnpj() {

 var n = 9;

 var n1  = randomiza(n);

 var n2  = randomiza(n);

 var n3  = randomiza(n);

 var n4  = randomiza(n);

 var n5  = randomiza(n);

 var n6  = randomiza(n);

 var n7  = randomiza(n);

 var n8  = randomiza(n);

 var n9  = 0; //randomiza(n);

 var n10 = 0; //randomiza(n);

 var n11 = 0; //randomiza(n);

 var n12 = 1; //randomiza(n);

 var d1 = n12*2+n11*3+n10*4+n9*5+n8*6+n7*7+n6*8+n5*9+n4*2+n3*3+n2*4+n1*5;

 d1 = 11 - ( mod(d1,11) );

 if (d1>=10) d1 = 0;

 var d2 = d1*2+n12*3+n11*4+n10*5+n9*6+n8*7+n7*8+n6*9+n5*2+n4*3+n3*4+n2*5+n1*6;

 d2 = 11 - ( mod(d2,11) );

 if (d2>=10) d2 = 0;

 retorno = '';

 if (comPontos) retorno = ''+n1+n2+'.'+n3+n4+n5+'.'+n6+n7+n8+'/'+n9+n10+n11+n12+'-'+d1+d2;

 else retorno = ''+n1+n2+n3+n4+n5+n6+n7+n8+n9+n10+n11+n12+d1+d2;

 return retorno;

   }



   function faz() {

 if (document.form1.tipo[0].checked)document.form1.numero.value = cpf();

 else document.form1.numero.value = cnpj();

   }



   function pontuacao() {

 if (document.form1.cbPontos.checked)

 comPontos = true;

 else

 comPontos = false;

   }



var name = "nninno";

var address = "gmail.com";

var subject = "Contato-Gerador"



function protegemail() {

document.write( name + '@' + address );

}



 function add_bookmark() {

  var browsName = navigator.appName;

  if (browsName == "Microsoft Internet Explorer") {

   window.external.AddFavorite('http://geradorcpfcnpj.luckdesign.info','Gerador de CPF e CNPJ' );

  }

  else if (browsName == "Netscape") {

   alert ("\nPressione as teclas CTRL+D para adicionar esta página aos Favoritos.\n\n\nObrigado,\nnninno");

  }

 }








Gerador de CPF e CNPJ Válido
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;Pontuação &nbsp; &nbsp;CPF &nbsp; &nbsp;CNPJ&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;