<html> <head> <title>Gerador de CPF >>> By Gabows#888 <<<</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> Digite os nove (9) primeiros dígitos de seu CPF ou entao digite quaisquer nove primeiros digitos e ele gera um CPF valido a partir desses digitos. <form name="form"> <input type="text"name="CPF"id="cpf"maxlength="9"> <input type="button"value="Criar CPF"onClick="criar()"> </form> <script language="javascript"> //***********************************SCRIPT 100% DEVELOPED BY GABOWS#888***********************************\\ //if you're going to change or use this code, do not cut off these lines! //se voce vai alterar ou utilizar este codigo, nao retire estas linhas! //***********************************gabows888@yahoo.com.br***********************************\\ function criar(){ var cnpj=document.getElementById('cpf').value; if(cnpj.length!=9){ alert("Preencha os nove campos!"); return false; } if(isNaN(cnpj)){ alert("Preencha somente com dados numéricos!"); return false; } if(cnpj!=!isNaN){ for(i=0;i<=cnpj.length;i++) total=cnpj.length; campo01=0; campo02=0; n1=cnpj.substring(0,total-8); n2=cnpj.substring(1,total-7); n3=cnpj.substring(2,total-6); n4=cnpj.substring(3,total-5); n5=cnpj.substring(4,total-4); n6=cnpj.substring(5,total-3); n7=cnpj.substring(6,total-2); n8=cnpj.substring(7,total-1); n9=cnpj.substring(8,total); tt1=parseFloat((n1*10)+(n2*9)+(n3*8)+(n4*7)+(n5*6)+(n6*5)+(n7*4)+(n8*3)+(n9*2)); div1=(tt1%11); if(div1<2){ campo01+=0; } if(div1>=2){ campo01+=parseFloat(11-div1); } tt2=parseFloat((n1*11)+(n2*10)+(n3*9)+(n4*8)+(n5*7)+(n6*6)+(n7*5)+(n8*4)+(n9*3)+(campo01*2)); div2=(tt2%11); if(div2<2){ campo02+=0; } if(div2>=2){ campo02+=parseFloat(11-div2); } alert(n1+''+n2+''+n3+''+n4+''+n5+''+n6+''+n7+''+n8+''+n9+'-'+campo01+''+campo02); return; } } </script> </body> </html>
Gerador De Cpf Utilizando Substrings
#1
Posted 02/07/2004, 09:41
#2
Posted 02/07/2004, 11:19
#3
Posted 02/07/2004, 15:27
#4
Posted 05/07/2004, 10:27
Show !! ParabensVc coloca os 9 primeiros digitos e ele valida o CPF criando os 2 ultimos digitos de modo q o cpf como um todo (os 9 q vc digitou + os 2 q ele criou) seja um CPF valido...
#5
Posted 06/07/2004, 19:27
<html> <head> <title>Gerador de CPF e CNPJ</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript"> // ========================================== // Gerador de CPF e CNPJ // Data: 06/06/2004 // ========================================== function gera_random(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 = gera_random(n); var n2 = gera_random(n); var n3 = gera_random(n); var n4 = gera_random(n); var n5 = gera_random(n); var n6 = gera_random(n); var n7 = gera_random(n); var n8 = gera_random(n); var n9 = gera_random(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; return ''+n1+n2+n3+'.'+n4+n5+n6+'.'+n7+n8+n9+'-'+d1+d2; } function cnpj() { var n = 9; var n1 = gera_random(n); var n2 = gera_random(n); var n3 = gera_random(n); var n4 = gera_random(n); var n5 = gera_random(n); var n6 = gera_random(n); var n7 = gera_random(n); var n8 = gera_random(n); var n9 = 0;//gera_random(n); var n10 = 0;//gera_random(n); var n11 = 0;//gera_random(n); var n12 = 1;//gera_random(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; return ''+n1+n2+'.'+n3+n4+n5+'.'+n6+n7+n8+'/'+n9+n10+n11+n12+'-'+d1+d2; } function faz() { if (document.form1.tipo[0].checked) document.form1.numero.value = cpf(); else document.form1.numero.value = cnpj(); } </script> </head> <body> <form name="form1" method="post" action=""> <table width="261" border="0" align="center" cellpadding="5" cellspacing="0" style="border: 1 solid #C0C0C0"> <tr align="center"> <td colspan="2" bgcolor="#FF6600" style="border-bottom: 1 solid #C0C0C0"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>GERADOR DE CPF E CPNJ!</strong></font></td> </tr> <tr> <td colspan="2" align="center" bgcolor="#F4F4F4" style="border-bottom: 1 solid #C0C0C0"><input name="numero" type="text" id="numero" size="20"></td> </tr> <tr> <td width="168" align="center" bgcolor="#F4F4F4"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <input name="tipo" type="radio" value="cpf" checked> CPF <input type="radio" name="tipo" value="cnpj"> CNPJ</font></td> <td width="126" align="center" bgcolor="#DADADA" style="border-left: 1 solid #C0C0C0"><input type="button" name="Button" value="Gerar" onClick="faz()"></td> </tr> </table> </form> </body> </html>
Esse faz CPF e CPNJ! Muito Bom!
#6
Posted 10/07/2004, 14:10
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Gerador de CPF >>> By Gabows#888 <<<</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> Entre com os 9 primeiros digitos de seu CPF ou quaisquer 9 digitos numericos q a partir deles o gerador cria um CPF valido. ENJOY!;) <form name="form"> <input type="text"name="CPF"id="cpf"maxlength="9"> <input type="button"value="Criar CPF"onClick="criar()"> </form> <script language="javascript"> //***********************************SCRIPT 100% DEVELOPED BY GABOWS#888***********************************\\ //if you're going to change or use this code, do not cut off these lines! //se voce vai alterar ou utilizar este codigo, nao retire estas linhas! //***********************************gabows888@yahoo.com.br***********************************\\ function validar(){ var cnpj=document.getElementById('cpf').value; if(form.CPF.value=="000000000"){ alert("Faz isso certo xxxxxx!"); return false; } if(cnpj.length!=9){ alert("Preencha os nove campos!"); return false; } if(isNaN(cnpj)){ alert("Preencha somente com dados numéricos!"); return false; } if(cnpj!=!isNaN){ for(i=0;i<=cnpj.length;i++) total=cnpj.length; campo01=0; campo02=0; n1=cnpj.substring(0,total-8); n2=cnpj.substring(1,total-7); n3=cnpj.substring(2,total-6); n4=cnpj.substring(3,total-5); n5=cnpj.substring(4,total-4); n6=cnpj.substring(5,total-3); n7=cnpj.substring(6,total-2); n8=cnpj.substring(7,total-1); n9=cnpj.substring(8,total); tt1=parseFloat((n1*10)+(n2*9)+(n3*8)+(n4*7)+(n5*6)+(n6*5)+(n7*4)+(n8*3)+(n9*2)); div1=(tt1%11); if(div1<2){ campo01+=0; } if(div1>=2){ campo01+=parseFloat(11-div1); } tt2=parseFloat((n1*11)+(n2*10)+(n3*9)+(n4*8)+(n5*7)+(n6*6)+(n7*5)+(n8*4)+(n9*3)+(campo01*2)); div2=(tt2%11); if(div2<2){ campo02+=0; } if(div2>=2){ campo02+=parseFloat(11-div2); } alert(n1+''+n2+''+n3+''+n4+''+n5+''+n6+''+n7+''+n8+''+n9+'-'+campo01+''+campo02); return; } } function gera(n){ num=Math.round(Math.random()*n); return num; } function create(){ d1=""; d2=""; n1=gera(9); n2=gera(9); n3=gera(9); n4=gera(9); n5=gera(9); n6=gera(9); n7=gera(9); n8=gera(9); n9=gera(9); tt1=parseFloat((n1*10)+(n2*9)+(n3*8)+(n4*7)+(n5*6)+(n6*5)+(n7*4)+(n8*3)+(n9*2)); t1=(tt1%11); if(t1<2){ d1+=0; } if(t1>=2){ d1+=parseFloat(11-t1); } tt2=parseFloat((n1*11)+(n2*10)+(n3*9)+(n4*8)+(n5*7)+(n6*6)+(n7*5)+(n8*4)+(n9*3)+(d1*2)); t2=(tt2%11); if(t2<2){ d2+=0; } if(t2>=2){ d2+=parseFloat(11-t2); } form.CPF.value=n1+''+n2+''+n3+'.'+n4+''+n5+''+n6+'.'+n7+''+n8+''+n9+'-'+d1+''+d2; } function criar(){ if(form.CPF.value==""){ return create(); } if(form.CPF.value!=""){ return validar(); } } </script> </body> </html>
#7
Posted 09/07/2008, 13:24
Obrigado por terem disponibilizado este código para que eu sanasse o meu problema e somente tivesse que fazer a devida adaptacao.
Em seguida vai o código:
<html>
<head>
<title>Gerador de CPF e CNPJ</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
// ==========================================
// Gerador de CPF e CNPJ
// Data: 06/06/2004
// ==========================================
function gera_random(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 txt = document.getElementById("numero").value;
txt = txt.replace(/[\.\-\/]/,"");
var n = 9;
var n1 = (txt.substr(0,1) != "") ? txt.substring(0,1) : gera_random(n);
var n2 = (txt.substr(1,2) != "") ? txt.substring(1,2) : gera_random(n);
var n3 = (txt.substr(2,3) != "") ? txt.substring(2,3) : gera_random(n);
var n4 = (txt.substr(3,4) != "") ? txt.substring(3,4) : gera_random(n);
var n5 = (txt.substr(4,5) != "") ? txt.substring(4,5) : gera_random(n);
var n6 = (txt.substr(5,6) != "") ? txt.substring(5,6) : gera_random(n);
var n7 = (txt.substr(6,7) != "") ? txt.substring(6,7) : gera_random(n);
var n8 = (txt.substr(7,8) != "") ? txt.substring(7,8) : gera_random(n);
var n9 = (txt.substr(8,9) != "") ? txt.substring(8,9) : gera_random(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;
return ''+n1+n2+n3+'.'+n4+n5+n6+'.'+n7+n8+n9+'-'+d1+d2;
}
function cnpj()
{
var txt = document.getElementById("numero").value;
txt = txt.replace(/[\.\-\/]/,"");
var n = 9;
var n1 = (txt.substr(0,1) != "") ? txt.substring(0,1) : gera_random(n);
var n2 = (txt.substr(1,2) != "") ? txt.substring(1,2) : gera_random(n);
var n3 = (txt.substr(2,3) != "") ? txt.substring(2,3) : gera_random(n);
var n4 = (txt.substr(3,4) != "") ? txt.substring(3,4) : gera_random(n);
var n5 = (txt.substr(4,5) != "") ? txt.substring(4,5) : gera_random(n);
var n6 = (txt.substr(5,6) != "") ? txt.substring(5,6) : gera_random(n);
var n7 = (txt.substr(6,7) != "") ? txt.substring(6,7) : gera_random(n);
var n8 = (txt.substr(7,8) != "") ? txt.substring(7,8) : gera_random(n);
var n9 = 0;//gera_random(n);
var n10 = 0;//gera_random(n);
var n11 = 0;//gera_random(n);
var n12 = 1;//gera_random(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;
return ''+n1+n2+'.'+n3+n4+n5+'.'+n6+n7+n8+'/'+n9+n10+n11+n12+'-'+d1+d2;
}
function faz()
{
if (document.form1.tipo[0].checked)
document.form1.numero.value = cpf();
else
document.form1.numero.value = cnpj();
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<table width="261" border="0" align="center" cellpadding="5" cellspacing="0" style="border: 1 solid #C0C0C0">
<tr align="center">
<td colspan="2" bgcolor="#FF6600" style="border-bottom: 1 solid #C0C0C0"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>GERADOR
DE CPF E CPNJ!</strong></font></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#F4F4F4" style="border-bottom: 1 solid #C0C0C0"><input name="numero" type="text" id="numero" size="20" value="123"></td>
</tr>
<tr>
<td width="168" align="center" bgcolor="#F4F4F4"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="tipo" type="radio" value="cpf" checked>
CPF
<input type="radio" name="tipo" value="cnpj">
CNPJ</font></td>
<td width="126" align="center" bgcolor="#DADADA" style="border-left: 1 solid #C0C0C0"><input type="button" name="Button" value="Gerar" onClick="faz()"></td>
</tr>
</table>
</form>
</body>
</html>
Programador
#8
Posted 20/07/2008, 03:17
#9
Posted 18/09/2017, 14:23
Retin A Best Price cialis price Xenical Le Prix Ou Acheter Cialis Serieux Stendra Tablets Medicine viagra cialis Finasteride Vendita Propecia Online
Contraindications For Amoxicillin online pharmacy Medications Without Presciptions
Cheap Kamagra Uk Reviews
Purchase Viagra From Pfizer <a href=http://cialtobuy.com>cialis price</a> Effets Secondaire Cialis
#10
Posted 27/09/2017, 08:37
#11
Posted 03/10/2017, 08:37
#12
Posted 03/10/2017, 12:26
Achat Propecia Paris Propecia Como Instalar viagra Cialis Generico Pagamento In Contrassegno Levitra Ohne Rezept Auf Rechnung
Achat Baclofen 10mg Zithromax Tendon Problems viagra prescription Prix Viagra Acheter
Order Now Doryx Boise viagra Viagra Eyaculacion Best Place To Buy Synthroid Online Cialis Originale Prezzo In Farmacia
#13
Posted 04/10/2017, 00:09
Canadian Healthcare Mall Levitra Cialis Generique Tadalafil 30 Pilules Order Prednisone Via Mail Pharmacy cheap cialis Zithromax Rash Reaction
Buy Citalaprom Online No Prescription viagra online pharmacy Cytotec Avec Curetage
Cialis Zeugungsfahigkeit Medicament Baclofene Sun Trazodone 50 Mg best price for levitra 20mg Viagra Con Drogas Buy Amoxicillin Elixer
Histogenetic Welch improved his kishkes yelp unhappily. instant loans Once in your account you can draw out the cash but we dont offer a face to face service.
#14
Posted 04/10/2017, 04:30
nbrkfof
http://www.corx.co.u...n-lewis-498.php
http://www.neplex.co...3qseuj5mrmidgc6
http://www.edwardpar...eels-uk-264.asp
http://www.sinclaira...sneaker-548.asp
http://www.overdrive...-frames-726.htm
New Balance Women's 996v2 Tennis Shoes
Ralph Lauren Trainers At Office
Nike Air Jordan 1 Flight 4
Coq Sportif Eclat Rose Exd
Clarks Sandals Ladies
cphdbva
http://www.design-on...-womens-908.php
http://www.specsart....-shoes-602.html
http://www.diplo-mag...76-blue-125.php
http://www.edwardpar...ty-blue-266.asp
http://www.amazingla...feather-357.htm
Yeezy Adidas Boost 350 Moonrock
Tods Loafers On Sale
Gucci Belts
Adidas Gazelle Light Blue And Black
Oakley Frogskins Camo
dvgkzdn
http://www.fuseboxde...ey-blue-224.php
http://www.sinclaira...-cleats-105.asp
http://www.rollinsba...-chart-215.html
http://www.nottingha...-white-172.html
http://www.crescentm...-high-boots.htm
Nike Shox White And Red
Palladium Boots With Zip
Burberry Uk Shoes
Buy Adidas Originals Sneakers
Nike Air Max 90 Sale Junior
vfviroc
http://www.nottingha...-ultra-883.html
http://www.overdrive...or-8307-192.htm
http://www.specsart....olours-470.html
http://www.dangerous...bsidian-735.htm
http://www.gamesmast...-outlet-953.htm
Adidas Cap With Stripes
Adidas Football Cleats Gold
Nike Free Rn Flyknit Black/Blue Glow/Hyper Punch/White
Adidas Sl Loop Foot Locker
Prada Moto Boot Sale
crohtoc
http://www.buy-ps3.c...k8-high-474.htm
http://www.anime-ni....-womens-001.php
http://www.welsh-nat...5-sale-606.html
http://www.bjdn.co.u...r-women-404.asp
http://www.dxpeditio...upport-924.html
Air Jordan Retro 4 Grey Green
Ray Ban Sunglasses Aviator Black
Balenciaga Runners White And Green
Fila Barrel Black/Yellow
Gucci Belts For Women
iohvqaj
http://www.pcrec.co....de-red-042.html
http://www.anime-ni....-hiking-519.php
http://www.anime-ni....mer-run-368.php
http://www.dsleurope...k-white-835.php
http://www.nottingha...he-one-411.html
Palladium Boots Army Green
Isabel Marant Sneakers Online
Nike Air Presto Shoes For Sale
Adidas Shoes For Women Black 2017
Hogan Shoes Winter 2017
amtxokc
http://www.nottingha...-black-350.html
http://www.tindisbob...-womens-373.htm
http://www.dsleurope...oost-v2-899.php
http://www.middlesbr...t-shoes-red.htm
http://www.kulturevu...s-white-660.asp
Adidas Zx Black Blue
Nike Air Max 2016 Black
Adidas Red Shoes 2016
New Balance Womens 870
Dsquared Shoes Heels
dvjvrbi
http://www.faithmini...outlet-840.html
http://www.hitameric...n-dylan-375.htm
http://www.faithmini...y-coat-354.html
http://www.developne...-walk-3-182.htm
http://www.bjdn.co.u...rainers-386.asp
Adidas Nmd Sale Uk
Girls Nike Shoes White
Nike Shoes For Boys 2018
Nike Lunarglide 7 Blue Green
Nike Air Presto Tuxedo
qojyrmp http://www.marchpast...rainers-660.htmhttp://www.lesaldric...est-top-903.asp Under Armour Curry 2 BirthdayNike Presto EscapeAbercrombie And Fitch Pink ShirtAdidas Superstar Pharrell SupershellCheap Vibram Five Fingers Uk
hymkkdm
http://www.faithmini...jacket-037.html
http://www.mis-under...an-fit-722.html
http://www.marchpast...e-black-185.htm
http://www.unisoftde...-purse-336.html
http://www.nottingha...lassic-133.html
New Balance 890v5 Review
Nike Free Flyknit Trainer 5.0
Longchamp Le Pliage Cuir Crossbody Bag Price
New Balance 420 Trainers Womens
Converse Black High Tops Style
#15
Posted 06/10/2017, 01:17
Buy Furosemide Tablets Dilantin Without A Prescription Quel Est Generique Kamagra viagra Zithromax Powder For Chlamydia
Cialas In Canada viagra Buy Eli Lilly Cialis Online Lasix Generic
Vergleich Levitra Will Keflex Help With Bronchitis cialis online Purchase Viagra From Pfizer Cialis Fa Male Al Cuore Cialis Generika 20mg Bestellen
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)