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

remove useless urlsafe: false option

This commit is contained in:
s2
2015-08-27 23:37:05 +02:00
parent 9a72a2cfe2
commit 645d64b940
3 changed files with 6 additions and 25 deletions

View File

@@ -7,7 +7,6 @@ function srs(options, cb) {
} else {
options = options || {};
}
options.urlsafe = typeof(options.urlsafe) === 'boolean' ? options.urlsafe : true;
var length = options['length'] || 32;
@@ -27,9 +26,7 @@ function srs(options, cb) {
function _finish (buf) {
var string = buf.toString('base64');
if (options.urlsafe) {
string = string.replace(/\//g,'_').replace(/\+/g,'-');
}
string = string.replace(/\//g,'_').replace(/\+/g,'-');
return string.substr(0, length);
}