mirror of
https://github.com/S2-/securerandomstring.git
synced 2025-08-02 10:20:05 +02:00
remove useless urlsafe: false option
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user