1
0
mirror of https://github.com/S2-/securerandomstring.git synced 2025-08-03 02:40:04 +02:00

Merge branch 'master' into master

This commit is contained in:
Sandro Gomez
2017-11-24 10:25:02 -03:00
committed by GitHub
3 changed files with 73 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ function srs(options, cb) {
if (err) {
return cb(err);
}
return cb(null,_finish(buf));
return cb(null, _finish(buf));
});
}
// sync path
@@ -24,7 +24,7 @@ function srs(options, cb) {
return _finish(crypto.randomBytes(length));
}
function _finish (buf) {
function _finish(buf) {
var string = buf.toString('base64');
if (alphanumeric === true) {
string = string.replace(/[\W_]+/g,'');
@@ -34,7 +34,6 @@ function srs(options, cb) {
}
return string.substr(0, length);
}
};