matheuscas / pycpfcnpj

Python module for brazilian register numbers for persons (CPF) and companies (CNPJ).
MIT License
143 stars 44 forks source link

Removed unnecessary loops to create a random CPF and CNPJ #19

Closed rbran closed 6 years ago

rbran commented 6 years ago

This offers a significantly faster "gen" function for CPF and CNPJ: Old:

0.00010704994201660156 seconds

New:

$ python -c 'import time;from pycpfcnpj import gen;start_time = time.time();gen.cpf();print("%s seconds" % (time.time() - start_time))'
2.6464462280273438e-05 seconds
codecov[bot] commented 6 years ago

Codecov Report

Merging #19 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #19   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           7      7           
  Lines          84     91    +7     
=====================================
+ Hits           84     91    +7
Impacted Files Coverage Δ
pycpfcnpj/cpf.py 100% <100%> (ø) :arrow_up:
pycpfcnpj/cnpj.py 100% <100%> (ø) :arrow_up:
pycpfcnpj/gen.py 100% <100%> (ø) :arrow_up:
pycpfcnpj/calculation.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c9fb472...4a2080a. Read the comment docs.

rbran commented 6 years ago

@matheuscas fixed

matheuscas commented 6 years ago

Hey @rbran , have u looked my other comments?

rbran commented 6 years ago

@matheuscas Yes, both were fixed in https://github.com/matheuscas/pycpfcnpj/pull/19/commits/4a2080a4989c99070e21298527003fd4958da81d

matheuscas commented 6 years ago

Sorry for being late. Thanks for the contribution. :)