generate-password
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -0,1 +1,7 @@ | ||
# 1.4.1 / 2018-10-28 | ||
Bug fix to `randomNumber()` function that reduced entropy, resulting in a bias towards letters, generally. | ||
#### Notable Changes | ||
- [`21a12d0fd`](https://github.com/brendanashworth/generate-password/commit/21a12d0fd47c1b8f63a310da052cedf29ba5c00d) - fixed randomNumber's frontwards bias (Starkteetje) | ||
# 1.4.0 / 2018-1-20 | ||
@@ -36,2 +42,2 @@ Release that includes TypeScript definitions. | ||
# 1.1.1 / 2014-12-23 | ||
- Add `excludeSimilarCharacters` option | ||
- Add `excludeSimilarCharacters` option |
{ | ||
"name": "generate-password", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Easy library for generating unique passwords.", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -8,3 +8,7 @@ var crypto = require('crypto'); | ||
// gives a number between 0 (inclusive) and max (exclusive) | ||
return crypto.randomBytes(1)[0] % max; | ||
var rand = crypto.randomBytes(1)[0]; | ||
while (rand >= 256 - (256 % max)) { | ||
rand = crypto.randomBytes(1)[0]; | ||
} | ||
return rand % max; | ||
}; | ||
@@ -11,0 +15,0 @@ |
16714
226