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

just nerdy whitespace stuff

This commit is contained in:
s2
2017-11-24 14:33:16 +01:00
parent 86caee2274
commit 275814d49a
2 changed files with 3 additions and 5 deletions

View File

@@ -64,4 +64,3 @@ the async API returns the error to the callback.
## License
[MIT](https://github.com/aheckmann/node-ses/blob/master/LICENSE)

View File

@@ -27,10 +27,9 @@ function srs(options, cb) {
function _finish(buf) {
var string = buf.toString('base64');
if (alphanumeric === true) {
string = string.replace(/[\W_]+/g,'');
}
else {
string = string.replace(/\//g,'_').replace(/\+/g,'-');
string = string.replace(/[\W_]+/g, '');
} else {
string = string.replace(/\//g, '_').replace(/\+/g, '-');
}
return string.substr(0, length);
}