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

whitespace and ;

This commit is contained in:
s2
2015-08-27 22:46:08 +02:00
parent 1cc664c4fa
commit f82819850e
2 changed files with 8 additions and 10 deletions

View File

@@ -13,11 +13,9 @@ function srs(options, cb) {
if (cb) { if (cb) {
crypto.randomBytes(length, function(err, buf) { crypto.randomBytes(length, function(err, buf) {
if (err) { if (err) {
return cb(err) return cb(err);
} }
else { return cb(null,_finish(buf));
return cb(null,_finish(buf));
}
}); });
} }
// sync path // sync path

View File

@@ -29,28 +29,28 @@ var test = function(name, what, ref, c) {
// async tests // async tests
srs(function(err,sr) { srs(function(err, sr) {
test('generate a random string 32 chars long', test('generate a random string 32 chars long',
sr.length, sr.length,
32 32
); );
}); });
srs({length: 1}, function(err,sr) { srs({length: 1}, function(err, sr) {
test('generate a random string 1 char long', test('generate a random string 1 char long',
sr.length, sr.length,
1 1
); );
}); });
srs({length: 256}, function(err,sr) { srs({length: 256}, function(err, sr) {
test('generate a random string 256 chars long', test('generate a random string 256 chars long',
sr.length, sr.length,
256 256
); );
}); });
srs({length: 256, urlsafe: true}, function(err,sr) { srs({length: 256, urlsafe: true}, function(err, sr) {
test('generate a urlsafe random string 256 chars long', test('generate a urlsafe random string 256 chars long',
sr.length, sr.length,
256 256