-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
108 lines (98 loc) · 20.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<html>
<head>
<title>Demo, CRPconvert</title>
<script src="src/convert.js"></script>
<script>
var cc = new CRPconvert('64569-010');
function assertMsg(val,cmp){
return (val==cmp)? val: ("ERROR(v=<b>"+val+"</b>!="+cmp+")");
}
</script>
</head>
<body>
<h1><a href="https://github.com/ppKrauss/CRP">Código de Roteamento Postal</a> (CRP)</h1>
<h2>Usando no Javascript</h2>
<pre>
var cc = new CRPconvert('64569-010');
console.log( cc.crp, cc.state() ); // <script>document.write( cc.crp )</script> , ...
// ... <script>document.write( JSON.stringify(cc.state()) )</script>
console.log( cc.set('AL456-011').asCEP() ); // <script>document.write( cc.set('AL456-011').asCEP() )</script>
console.log( cc.asCEP('AL456-011') ); // <script>document.write( cc.asCEP('AL456-011') )</script>
console.log( cc.set('69345-678').asCEP() ); // <script>document.write( cc.set('69345-678').asCEP() )</script>
... teste você mesmo!
</pre>
<h1>TESTES</h1>
Cada entrada abaixo de "códigoX=códigoY" está sendo gerada pela lib <a href="src/convert.js">convert.js</a> no ato da carga da página.
Para auditar <i>asserts</i>, ver código-fonte deste HTML.
<h2>Conversões CEP to CRP</h2>
A listagem abaixo foi gerada com <code>php <a href="https://github.com/ppKrauss/CRP/blob/master/src/demo1.php">src/demo.php</a> 1</code>.
<ul>
<li>69900-000=<script>document.write( assertMsg(cc.set('69900-000').crp,'AC00-000') )</script>; 69950-197=<script>document.write( assertMsg(cc.set('69950-197').crp,'AC50-197') )</script>; 69999-999=<script>document.write( assertMsg(cc.set('69999-999').crp,'AC99-999') )</script></li>
<li>69300-000=<script>document.write( assertMsg(cc.set('69300-000').crp,'RR00-000') )</script>; 69349-878=<script>document.write( assertMsg(cc.set('69349-878').crp,'RR49-878') )</script>; 69399-999=<script>document.write( assertMsg(cc.set('69399-999').crp,'RR99-999') )</script></li>
<li>68900-000=<script>document.write( assertMsg(cc.set('68900-000').crp,'AP00-000') )</script>; 68950-248=<script>document.write( assertMsg(cc.set('68950-248').crp,'AP50-248') )</script>; 68999-999=<script>document.write( assertMsg(cc.set('68999-999').crp,'AP99-999') )</script></li>
<li>69000-000=<script>document.write( assertMsg(cc.set('69000-000').crp,'AM000-000') )</script>; 69150-432=<script>document.write( assertMsg(cc.set('69150-432').crp,'AM150-432') )</script>; 69299-999=<script>document.write( assertMsg(cc.set('69299-999').crp,'AM299-999') )</script></li>
<li>69400-000=<script>document.write( assertMsg(cc.set('69400-000').crp,'AM400-000') )</script>; 69649-755=<script>document.write( assertMsg(cc.set('69649-755').crp,'AM649-755') )</script>; 69899-999=<script>document.write( assertMsg(cc.set('69899-999').crp,'AM899-999') )</script></li>
<li>65000-000=<script>document.write( assertMsg(cc.set('65000-000').crp,'MA000-000') )</script>; 65499-586=<script>document.write( assertMsg(cc.set('65499-586').crp,'MA499-586') )</script>; 65999-999=<script>document.write( assertMsg(cc.set('65999-999').crp,'MA999-999') )</script></li>
<li>64000-000=<script>document.write( assertMsg(cc.set('64000-000').crp,'PI000-000') )</script>; 64500-234=<script>document.write( assertMsg(cc.set('64500-234').crp,'PI500-234') )</script>; 64999-999=<script>document.write( assertMsg(cc.set('64999-999').crp,'PI999-999') )</script></li>
<li>60000-000=<script>document.write( assertMsg(cc.set('60000-000').crp,'CE0000-000') )</script>; 62000-122=<script>document.write( assertMsg(cc.set('62000-122').crp,'CE2000-122') )</script>; 63999-999=<script>document.write( assertMsg(cc.set('63999-999').crp,'CE3999-999') )</script></li>
<li>66000-000=<script>document.write( assertMsg(cc.set('66000-000').crp,'PA6000-000') )</script>; 67450-156=<script>document.write( assertMsg(cc.set('67450-156').crp,'PA7450-156') )</script>; 68899-999=<script>document.write( assertMsg(cc.set('68899-999').crp,'PA8899-999') )</script></li>
<li>79000-000=<script>document.write( assertMsg(cc.set('79000-000').crp,'MS000-000') )</script>; 79499-734=<script>document.write( assertMsg(cc.set('79499-734').crp,'MS499-734') )</script>; 79999-999=<script>document.write( assertMsg(cc.set('79999-999').crp,'MS999-999') )</script></li>
<li>78000-000=<script>document.write( assertMsg(cc.set('78000-000').crp,'MT000-000') )</script>; 78450-209=<script>document.write( assertMsg(cc.set('78450-209').crp,'MT450-209') )</script>; 78899-999=<script>document.write( assertMsg(cc.set('78899-999').crp,'MT899-999') )</script></li>
<li>77000-000=<script>document.write( assertMsg(cc.set('77000-000').crp,'TO000-000') )</script>; 77499-781=<script>document.write( assertMsg(cc.set('77499-781').crp,'TO499-781') )</script>; 77999-999=<script>document.write( assertMsg(cc.set('77999-999').crp,'TO999-999') )</script></li>
<li>76800-000=<script>document.write( assertMsg(cc.set('76800-000').crp,'RO800-000') )</script>; 76900-036=<script>document.write( assertMsg(cc.set('76900-036').crp,'RO900-036') )</script>; 76999-999=<script>document.write( assertMsg(cc.set('76999-999').crp,'RO999-999') )</script></li>
<li>73000-000=<script>document.write( assertMsg(cc.set('73000-000').crp,'DF3000-000') )</script>; 73349-915=<script>document.write( assertMsg(cc.set('73349-915').crp,'DF3349-915') )</script>; 73699-999=<script>document.write( assertMsg(cc.set('73699-999').crp,'DF3699-999') )</script></li>
<li>72800-000=<script>document.write( assertMsg(cc.set('72800-000').crp,'GO2800-000') )</script>; 72900-215=<script>document.write( assertMsg(cc.set('72900-215').crp,'GO2900-215') )</script>; 72999-999=<script>document.write( assertMsg(cc.set('72999-999').crp,'GO2999-999') )</script></li>
<li>70000-000=<script>document.write( assertMsg(cc.set('70000-000').crp,'DF0000-000') )</script>; 71400-266=<script>document.write( assertMsg(cc.set('71400-266').crp,'DF1400-266') )</script>; 72799-999=<script>document.write( assertMsg(cc.set('72799-999').crp,'DF2799-999') )</script></li>
<li>73700-000=<script>document.write( assertMsg(cc.set('73700-000').crp,'GO3700-000') )</script>; 75249-640=<script>document.write( assertMsg(cc.set('75249-640').crp,'GO5249-640') )</script>; 76799-999=<script>document.write( assertMsg(cc.set('76799-999').crp,'GO6799-999') )</script></li>
<li>59000-000=<script>document.write( assertMsg(cc.set('59000-000').crp,'RN000-000') )</script>; 59499-772=<script>document.write( assertMsg(cc.set('59499-772').crp,'RN499-772') )</script>; 59999-999=<script>document.write( assertMsg(cc.set('59999-999').crp,'RN999-999') )</script></li>
<li>58000-000=<script>document.write( assertMsg(cc.set('58000-000').crp,'PB000-000') )</script>; 58499-864=<script>document.write( assertMsg(cc.set('58499-864').crp,'PB499-864') )</script>; 58999-999=<script>document.write( assertMsg(cc.set('58999-999').crp,'PB999-999') )</script></li>
<li>57000-000=<script>document.write( assertMsg(cc.set('57000-000').crp,'AL000-000') )</script>; 57500-304=<script>document.write( assertMsg(cc.set('57500-304').crp,'AL500-304') )</script>; 57999-999=<script>document.write( assertMsg(cc.set('57999-999').crp,'AL999-999') )</script></li>
<li>50000-000=<script>document.write( assertMsg(cc.set('50000-000').crp,'PE0000-000') )</script>; 53499-742=<script>document.write( assertMsg(cc.set('53499-742').crp,'PE3499-742') )</script>; 56999-999=<script>document.write( assertMsg(cc.set('56999-999').crp,'PE6999-999') )</script></li>
<li>49000-000=<script>document.write( assertMsg(cc.set('49000-000').crp,'SE000-000') )</script>; 49500-255=<script>document.write( assertMsg(cc.set('49500-255').crp,'SE500-255') )</script>; 49999-999=<script>document.write( assertMsg(cc.set('49999-999').crp,'SE999-999') )</script></li>
<li>40000-000=<script>document.write( assertMsg(cc.set('40000-000').crp,'BA0000-000') )</script>; 44499-779=<script>document.write( assertMsg(cc.set('44499-779').crp,'BA4499-779') )</script>; 48999-999=<script>document.write( assertMsg(cc.set('48999-999').crp,'BA8999-999') )</script></li>
<li>29000-000=<script>document.write( assertMsg(cc.set('29000-000').crp,'ES000-000') )</script>; 29500-266=<script>document.write( assertMsg(cc.set('29500-266').crp,'ES500-266') )</script>; 29999-999=<script>document.write( assertMsg(cc.set('29999-999').crp,'ES999-999') )</script></li>
<li>20000-000=<script>document.write( assertMsg(cc.set('20000-000').crp,'RJ0000-000') )</script>; 24500-013=<script>document.write( assertMsg(cc.set('24500-013').crp,'RJ4500-013') )</script>; 28999-999=<script>document.write( assertMsg(cc.set('28999-999').crp,'RJ8999-999') )</script></li>
<li>90000-000=<script>document.write( assertMsg(cc.set('90000-000').crp,'RS0000-000') )</script>; 94999-541=<script>document.write( assertMsg(cc.set('94999-541').crp,'RS4999-541') )</script>; 99999-999=<script>document.write( assertMsg(cc.set('99999-999').crp,'RS9999-999') )</script></li>
<li>80000-000=<script>document.write( assertMsg(cc.set('80000-000').crp,'PR0000-000') )</script>; 84000-298=<script>document.write( assertMsg(cc.set('84000-298').crp,'PR4000-298') )</script>; 87999-999=<script>document.write( assertMsg(cc.set('87999-999').crp,'PR7999-999') )</script></li>
<li>88000-000=<script>document.write( assertMsg(cc.set('88000-000').crp,'SC8000-000') )</script>; 88999-931=<script>document.write( assertMsg(cc.set('88999-931').crp,'SC8999-931') )</script>; 89999-999=<script>document.write( assertMsg(cc.set('89999-999').crp,'SC9999-999') )</script></li>
<li>30000-000=<script>document.write( assertMsg(cc.set('30000-000').crp,'MG0000-000') )</script>; 35000-252=<script>document.write( assertMsg(cc.set('35000-252').crp,'MG5000-252') )</script>; 39999-999=<script>document.write( assertMsg(cc.set('39999-999').crp,'MG9999-999') )</script></li>
<li>11000-000=<script>document.write( assertMsg(cc.set('11000-000').crp,'SP1000-000') )</script>; 15499-921=<script>document.write( assertMsg(cc.set('15499-921').crp,'SP5499-921') )</script>; 19999-999=<script>document.write( assertMsg(cc.set('19999-999').crp,'SP9999-999') )</script></li>
<li>01000-000=<script>document.write( assertMsg(cc.set('01000-000').crp,'ZM1000-000') )</script>; 05500-128=<script>document.write( assertMsg(cc.set('05500-128').crp,'ZM5500-128') )</script>; 09999-999=<script>document.write( assertMsg(cc.set('09999-999').crp,'ZM9999-999') )</script></li>
</ul>
<h2>Conversões CRP to CEP</h2>
A listagem abaixo foi gerada com <code>php <a href="https://github.com/ppKrauss/CRP/blob/master/src/demo1.php">src/demo.php</a> 2</code>.
<ul>
<li>AC00-000=<script>document.write( assertMsg(cc.asCEP('AC00-000'),'69900-000') )</script>; AC49-865=<script>document.write( assertMsg(cc.asCEP('AC49-865'),'69949-865') )</script>; AC99-999=<script>document.write( assertMsg(cc.asCEP('AC99-999'),'69999-999') )</script></li>
<li>RR00-000=<script>document.write( assertMsg(cc.asCEP('RR00-000'),'69300-000') )</script>; RR50-025=<script>document.write( assertMsg(cc.asCEP('RR50-025'),'69350-025') )</script>; RR99-999=<script>document.write( assertMsg(cc.asCEP('RR99-999'),'69399-999') )</script></li>
<li>AP00-000=<script>document.write( assertMsg(cc.asCEP('AP00-000'),'68900-000') )</script>; AP50-223=<script>document.write( assertMsg(cc.asCEP('AP50-223'),'68950-223') )</script>; AP99-999=<script>document.write( assertMsg(cc.asCEP('AP99-999'),'68999-999') )</script></li>
<li>AM000-000=<script>document.write( assertMsg(cc.asCEP('AM000-000'),'69000-000') )</script>; AM150-088=<script>document.write( assertMsg(cc.asCEP('AM150-088'),'69150-088') )</script>; AM299-999=<script>document.write( assertMsg(cc.asCEP('AM299-999'),'69299-999') )</script></li>
<li>AM400-000=<script>document.write( assertMsg(cc.asCEP('AM400-000'),'69400-000') )</script>; AM650-253=<script>document.write( assertMsg(cc.asCEP('AM650-253'),'69650-253') )</script>; AM899-999=<script>document.write( assertMsg(cc.asCEP('AM899-999'),'69899-999') )</script></li>
<li>MA000-000=<script>document.write( assertMsg(cc.asCEP('MA000-000'),'65000-000') )</script>; MA500-350=<script>document.write( assertMsg(cc.asCEP('MA500-350'),'65500-350') )</script>; MA999-999=<script>document.write( assertMsg(cc.asCEP('MA999-999'),'65999-999') )</script></li>
<li>PI000-000=<script>document.write( assertMsg(cc.asCEP('PI000-000'),'64000-000') )</script>; PI499-794=<script>document.write( assertMsg(cc.asCEP('PI499-794'),'64499-794') )</script>; PI999-999=<script>document.write( assertMsg(cc.asCEP('PI999-999'),'64999-999') )</script></li>
<li>CE0000-000=<script>document.write( assertMsg(cc.asCEP('CE0000-000'),'60000-000') )</script>; CE1999-523=<script>document.write( assertMsg(cc.asCEP('CE1999-523'),'61999-523') )</script>; CE3999-999=<script>document.write( assertMsg(cc.asCEP('CE3999-999'),'63999-999') )</script></li>
<li>PA6000-000=<script>document.write( assertMsg(cc.asCEP('PA6000-000'),'66000-000') )</script>; PA7450-172=<script>document.write( assertMsg(cc.asCEP('PA7450-172'),'67450-172') )</script>; PA8899-999=<script>document.write( assertMsg(cc.asCEP('PA8899-999'),'68899-999') )</script></li>
<li>MS000-000=<script>document.write( assertMsg(cc.asCEP('MS000-000'),'79000-000') )</script>; MS500-006=<script>document.write( assertMsg(cc.asCEP('MS500-006'),'79500-006') )</script>; MS999-999=<script>document.write( assertMsg(cc.asCEP('MS999-999'),'79999-999') )</script></li>
<li>MT000-000=<script>document.write( assertMsg(cc.asCEP('MT000-000'),'78000-000') )</script>; MT450-285=<script>document.write( assertMsg(cc.asCEP('MT450-285'),'78450-285') )</script>; MT899-999=<script>document.write( assertMsg(cc.asCEP('MT899-999'),'78899-999') )</script></li>
<li>TO000-000=<script>document.write( assertMsg(cc.asCEP('TO000-000'),'77000-000') )</script>; TO500-360=<script>document.write( assertMsg(cc.asCEP('TO500-360'),'77500-360') )</script>; TO999-999=<script>document.write( assertMsg(cc.asCEP('TO999-999'),'77999-999') )</script></li>
<li>RO800-000=<script>document.write( assertMsg(cc.asCEP('RO800-000'),'76800-000') )</script>; RO900-121=<script>document.write( assertMsg(cc.asCEP('RO900-121'),'76900-121') )</script>; RO999-999=<script>document.write( assertMsg(cc.asCEP('RO999-999'),'76999-999') )</script></li>
<li>DF3000-000=<script>document.write( assertMsg(cc.asCEP('DF3000-000'),'73000-000') )</script>; DF3350-300=<script>document.write( assertMsg(cc.asCEP('DF3350-300'),'73350-300') )</script>; DF3699-999=<script>document.write( assertMsg(cc.asCEP('DF3699-999'),'73699-999') )</script></li>
<li>GO2800-000=<script>document.write( assertMsg(cc.asCEP('GO2800-000'),'72800-000') )</script>; GO2899-967=<script>document.write( assertMsg(cc.asCEP('GO2899-967'),'72899-967') )</script>; GO2999-999=<script>document.write( assertMsg(cc.asCEP('GO2999-999'),'72999-999') )</script></li>
<li>DF0000-000=<script>document.write( assertMsg(cc.asCEP('DF0000-000'),'70000-000') )</script>; DF1399-997=<script>document.write( assertMsg(cc.asCEP('DF1399-997'),'71399-997') )</script>; DF2799-999=<script>document.write( assertMsg(cc.asCEP('DF2799-999'),'72799-999') )</script></li>
<li>GO3700-000=<script>document.write( assertMsg(cc.asCEP('GO3700-000'),'73700-000') )</script>; GO5249-556=<script>document.write( assertMsg(cc.asCEP('GO5249-556'),'75249-556') )</script>; GO6799-999=<script>document.write( assertMsg(cc.asCEP('GO6799-999'),'76799-999') )</script></li>
<li>RN000-000=<script>document.write( assertMsg(cc.asCEP('RN000-000'),'59000-000') )</script>; RN499-739=<script>document.write( assertMsg(cc.asCEP('RN499-739'),'59499-739') )</script>; RN999-999=<script>document.write( assertMsg(cc.asCEP('RN999-999'),'59999-999') )</script></li>
<li>PB000-000=<script>document.write( assertMsg(cc.asCEP('PB000-000'),'58000-000') )</script>; PB500-157=<script>document.write( assertMsg(cc.asCEP('PB500-157'),'58500-157') )</script>; PB999-999=<script>document.write( assertMsg(cc.asCEP('PB999-999'),'58999-999') )</script></li>
<li>AL000-000=<script>document.write( assertMsg(cc.asCEP('AL000-000'),'57000-000') )</script>; AL499-849=<script>document.write( assertMsg(cc.asCEP('AL499-849'),'57499-849') )</script>; AL999-999=<script>document.write( assertMsg(cc.asCEP('AL999-999'),'57999-999') )</script></li>
<li>PE0000-000=<script>document.write( assertMsg(cc.asCEP('PE0000-000'),'50000-000') )</script>; PE3500-121=<script>document.write( assertMsg(cc.asCEP('PE3500-121'),'53500-121') )</script>; PE6999-999=<script>document.write( assertMsg(cc.asCEP('PE6999-999'),'56999-999') )</script></li>
<li>SE000-000=<script>document.write( assertMsg(cc.asCEP('SE000-000'),'49000-000') )</script>; SE500-019=<script>document.write( assertMsg(cc.asCEP('SE500-019'),'49500-019') )</script>; SE999-999=<script>document.write( assertMsg(cc.asCEP('SE999-999'),'49999-999') )</script></li>
<li>BA0000-000=<script>document.write( assertMsg(cc.asCEP('BA0000-000'),'40000-000') )</script>; BA4500-460=<script>document.write( assertMsg(cc.asCEP('BA4500-460'),'44500-460') )</script>; BA8999-999=<script>document.write( assertMsg(cc.asCEP('BA8999-999'),'48999-999') )</script></li>
<li>ES000-000=<script>document.write( assertMsg(cc.asCEP('ES000-000'),'29000-000') )</script>; ES500-455=<script>document.write( assertMsg(cc.asCEP('ES500-455'),'29500-455') )</script>; ES999-999=<script>document.write( assertMsg(cc.asCEP('ES999-999'),'29999-999') )</script></li>
<li>RJ0000-000=<script>document.write( assertMsg(cc.asCEP('RJ0000-000'),'20000-000') )</script>; RJ4500-062=<script>document.write( assertMsg(cc.asCEP('RJ4500-062'),'24500-062') )</script>; RJ8999-999=<script>document.write( assertMsg(cc.asCEP('RJ8999-999'),'28999-999') )</script></li>
<li>RS0000-000=<script>document.write( assertMsg(cc.asCEP('RS0000-000'),'90000-000') )</script>; RS4999-866=<script>document.write( assertMsg(cc.asCEP('RS4999-866'),'94999-866') )</script>; RS9999-999=<script>document.write( assertMsg(cc.asCEP('RS9999-999'),'99999-999') )</script></li>
<li>PR0000-000=<script>document.write( assertMsg(cc.asCEP('PR0000-000'),'80000-000') )</script>; PR3999-710=<script>document.write( assertMsg(cc.asCEP('PR3999-710'),'83999-710') )</script>; PR7999-999=<script>document.write( assertMsg(cc.asCEP('PR7999-999'),'87999-999') )</script></li>
<li>SC8000-000=<script>document.write( assertMsg(cc.asCEP('SC8000-000'),'88000-000') )</script>; SC8999-772=<script>document.write( assertMsg(cc.asCEP('SC8999-772'),'88999-772') )</script>; SC9999-999=<script>document.write( assertMsg(cc.asCEP('SC9999-999'),'89999-999') )</script></li>
<li>MG0000-000=<script>document.write( assertMsg(cc.asCEP('MG0000-000'),'30000-000') )</script>; MG5000-369=<script>document.write( assertMsg(cc.asCEP('MG5000-369'),'35000-369') )</script>; MG9999-999=<script>document.write( assertMsg(cc.asCEP('MG9999-999'),'39999-999') )</script></li>
<li>SP1000-000=<script>document.write( assertMsg(cc.asCEP('SP1000-000'),'11000-000') )</script>; SP5499-652=<script>document.write( assertMsg(cc.asCEP('SP5499-652'),'15499-652') )</script>; SP9999-999=<script>document.write( assertMsg(cc.asCEP('SP9999-999'),'19999-999') )</script></li>
<li>ZM1000-000=<script>document.write( assertMsg(cc.asCEP('ZM1000-000'),'01000-000') )</script>; ZM5499-842=<script>document.write( assertMsg(cc.asCEP('ZM5499-842'),'05499-842') )</script>; ZM9999-999=<script>document.write( assertMsg(cc.asCEP('ZM9999-999'),'09999-999') )</script></li>
</ul>
</body>
</html>