mirror of
https://github.com/S2-/securerandomstring.git
synced 2025-08-05 19:30:07 +02:00
Compare commits
4 Commits
a6dc243138
...
v1.1.3
Author | SHA1 | Date | |
---|---|---|---|
f7e565bcc7 | |||
f82de05f4b | |||
94f2eadf63 | |||
394d13d5a7 |
@@ -31,6 +31,9 @@ function srs(options, cb) {
|
|||||||
} else {
|
} else {
|
||||||
string = string.replace(/\//g, '_').replace(/\+/g, '-');
|
string = string.replace(/\//g, '_').replace(/\+/g, '-');
|
||||||
}
|
}
|
||||||
|
if (string.length < length) {
|
||||||
|
throw new Error(`Generated string is too short. Please catch this Error and try again.`);
|
||||||
|
}
|
||||||
return string.substr(0, length);
|
return string.substr(0, length);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "secure-random-string",
|
"name": "secure-random-string",
|
||||||
"version": "1.1.0",
|
"version": "1.1.3",
|
||||||
"description": "Generates a secure random string with a given length",
|
"description": "Generates a secure random string with a given length",
|
||||||
"main": "lib/secure-random-string.js",
|
"main": "lib/secure-random-string.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,7 +19,9 @@
|
|||||||
"token"
|
"token"
|
||||||
],
|
],
|
||||||
"author": "Simon Santoro",
|
"author": "Simon Santoro",
|
||||||
"contributors": ["Mark Stosberg <mark@rideamigos.com>"],
|
"contributors": [
|
||||||
|
"Mark Stosberg <mark@rideamigos.com>"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/S2-/securerandomstring/issues"
|
"url": "https://github.com/S2-/securerandomstring/issues"
|
||||||
|
Reference in New Issue
Block a user