mirror of
https://github.com/S2-/securerandomstring.git
synced 2025-08-02 10:20:05 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
f7e565bcc7 | |||
f82de05f4b |
@@ -31,6 +31,9 @@ function srs(options, cb) {
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "secure-random-string",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "Generates a secure random string with a given length",
|
||||
"main": "lib/secure-random-string.js",
|
||||
"scripts": {
|
||||
|
Reference in New Issue
Block a user