secure-random-string
Advanced tools
Comparing version 1.1.0 to 1.1.2
{ | ||
"name": "secure-random-string", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"description": "Generates a secure random string with a given length", | ||
@@ -22,3 +22,5 @@ "main": "lib/secure-random-string.js", | ||
"author": "Simon Santoro", | ||
"contributors": ["Mark Stosberg <mark@rideamigos.com>"], | ||
"contributors": [ | ||
"Mark Stosberg <mark@rideamigos.com>" | ||
], | ||
"license": "MIT", | ||
@@ -25,0 +27,0 @@ "bugs": { |
@@ -11,4 +11,6 @@ # secure-random-string | ||
### Default behavior: Generate a random string 32 characters long. | ||
### Default behavior: Generate a random Base64 encoded string 32 characters long. | ||
This may include alphanumeric characters as well as the following characters: +, /, =. | ||
```javascript | ||
@@ -63,3 +65,3 @@ // Sync | ||
[Mark Stosberg](https://github.com/markstos) | ||
[Mark Stosberg](https://github.com/markstos) | ||
[Sandro Gomez](https://github.com/mrsangrin) | ||
@@ -69,2 +71,2 @@ | ||
[MIT](https://github.com/aheckmann/node-ses/blob/master/LICENSE) | ||
[MIT](https://opensource.org/licenses/MIT) |
@@ -59,2 +59,10 @@ var srs = require('./lib/secure-random-string.js'); | ||
}); | ||
srs({alphanumeric: true, length: 40}, function(err, sr) {; | ||
test('Must contain alphanumeric only and be 40 chars long', | ||
sr.match(/^[a-zA-Z0-9_]*$/g)[0] === sr && sr.length === 40, | ||
true | ||
); | ||
}); | ||
// sync tests | ||
@@ -61,0 +69,0 @@ test('generate a random string 32 chars long (sync)', srs().length, 32); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7202
96
70