cpf_and_cnpj-generator
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(()=>(()=>{"use strict";var e={52:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const o=r(724);t.default=function(){const e=new Array(14);for(let t=0;t<12;t++)e[t]=(0,o.default)();return e[12]=function(e){const t=[5,4,3,2,9,8,7,6,5,4,3,2];let r=0;for(let o=0;o<12;o++)r+=e[o]*t[o];const o=r%11;return o<2?0:11-o}(e),e[13]=function(e,t){const r=[6,5,4,3,2,9,8,7,6,5,4,3,2];let o=0;for(let t=0;t<12;t++)o+=e[t]*r[t];o+=t*r[12];const n=o%11;return n<2?0:11-n}(e,e[12]),e.join("")}},826:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const o=r(724);function n(e,t,r){let o=0;for(let n=0;n<t;n++)o+=e[n]*(r-n);return o%11<2?0:11-o%11}t.default=function(){const e=new Array(11);for(let t=0;t<9;t++)e[t]=(0,o.default)();return e[9]=n(e,9,10),e[10]=n(e,10,11),e.join("")}},724:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return Math.floor(10*Math.random())}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var f=t[o]={exports:{}};return e[o](f,f.exports,r),f.exports}var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.generateCpf=e.generateCnpj=void 0;const t=r(52);e.generateCnpj=t.default;const n=r(826);e.generateCpf=n.default})(),o})())); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(()=>(()=>{"use strict";var e={52:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=o(724);t.default=function(){const e=new Array(14);for(let t=0;t<12;t++)e[t]=(0,r.default)();return e[12]=function(e){const t=[5,4,3,2,9,8,7,6,5,4,3,2];let o=0;for(let r=0;r<12;r++)o+=e[r]*t[r];const r=o%11;return r<2?0:11-r}(e),e[13]=function(e,t){const o=[6,5,4,3,2,9,8,7,6,5,4,3,2];let r=0;for(let t=0;t<12;t++)r+=e[t]*o[t];r+=t*o[12];const n=r%11;return n<2?0:11-n}(e,e[12]),e.join("")}},826:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=o(724);function n(e,t,o){let r=0;for(let n=0;n<t;n++)r+=e[n]*(o-n);const n=r%11;return n<2?0:11-n}t.default=function(){const e=new Array(11);for(let t=0;t<9;t++)e[t]=(0,r.default)();return e[9]=n(e,9,10),e[10]=n(e,10,11),e.join("")}},724:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return Math.floor(10*Math.random())}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var f=t[r]={exports:{}};return e[r](f,f.exports,o),f.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.generateCpf=e.generateCnpj=void 0;const t=o(52);e.generateCnpj=t.default;const n=o(826);e.generateCpf=n.default})(),r})())); |
@@ -9,3 +9,4 @@ "use strict"; | ||
} | ||
return sum % 11 < 2 ? 0 : 11 - (sum % 11); | ||
const remainder = sum % 11; | ||
return remainder < 2 ? 0 : 11 - remainder; | ||
} | ||
@@ -12,0 +13,0 @@ function geraEValida() { |
{ | ||
"name": "cpf_and_cnpj-generator", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "This repository contains a JavaScript code that generates a valid Brazilian CPF (Cadastro de Pessoas Físicas). CPF is a unique identification number assigned to individuals in Brazil. The code ensures that the generated CPF numbers follow the required validation rules and algorithms.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -24,7 +24,7 @@ # CPF and CNPJ Generator / Gerador de CPF e CNPJ | ||
```bash | ||
https://unpkg.com/cpf_and_cnpj-generator@1.2.2/dist/bundle.js | ||
https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js | ||
``` | ||
```html | ||
<script src="https://unpkg.com/cpf_and_cnpj-generator@1.2.2/dist/bundle.js"></script> | ||
<script src="https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js"></script> | ||
``` | ||
@@ -35,3 +35,3 @@ | ||
```bash | ||
https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.2/+esm | ||
https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm | ||
``` | ||
@@ -44,3 +44,3 @@ | ||
generateCnpj, | ||
} from "https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.2/+esm"; | ||
} from "https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm"; | ||
</script> | ||
@@ -111,7 +111,7 @@ ``` | ||
```bash | ||
https://unpkg.com/cpf_and_cnpj-generator@1.2.2/dist/bundle.js | ||
https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js | ||
``` | ||
```html | ||
<script src="https://unpkg.com/cpf_and_cnpj-generator@1.2.2/dist/bundle.js"></script> | ||
<script src="https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js"></script> | ||
``` | ||
@@ -122,3 +122,3 @@ | ||
```bash | ||
https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.2/+esm | ||
https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm | ||
``` | ||
@@ -131,3 +131,3 @@ | ||
generateCnpj, | ||
} from "https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.2/+esm"; | ||
} from "https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm"; | ||
</script> | ||
@@ -134,0 +134,0 @@ ``` |
@@ -1,4 +0,1 @@ | ||
/** | ||
* This module exports two functions for generating valid CNPJ and CPF numbers. | ||
*/ | ||
import cnpjGenerator from "./src/cnpjGenerator"; | ||
@@ -5,0 +2,0 @@ import cpfGenerator from "./src/cpfGenerator"; |
12489
-0.39%86
-2.27%