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

1.0.0: Add sync API and update async API to pass error to callback as the first argument.

This commit is contained in:
Mark Stosberg
2015-08-27 16:25:30 -04:00
parent 3358bf21fc
commit 1cc664c4fa
5 changed files with 37 additions and 11 deletions

View File

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