brendanashworth / generate-password

NodeJS library for generating cryptographically-secure passwords.
MIT License
354 stars 67 forks source link

fix strict password generation #11

Closed brendanashworth closed 8 years ago

brendanashworth commented 8 years ago

Previously, there was a bug in the strict password generation that wouldn't correctly check whether or not the password contained all the correct characters more than twice in a row. This is now fixed by using simple recursion as opposed to a trampoline.

This should be prevented in the future with better tests, that have been added. This wasn't caught before the merge because of an insignificant amount of runs for these functions, as the odds of the bug occurring were relatively low. Each test will now be run 500 times when entropy is a factor.

This also fixes the regex for symbols.

codecov-io commented 8 years ago

Current coverage is 100% (diff: 100%)

Merging #11 into master will not change coverage

@@           master   #11   diff @@
===================================
  Files           1     1          
  Lines          56    43    -13   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
- Hits           56    43    -13   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update c69e2ef...96d58d6