We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72336c9 commit a9b55a8Copy full SHA for a9b55a8
test/random-bytes.js
@@ -4,11 +4,11 @@ var crypto = require('../')
4
test('randomBytes', function (t) {
5
t.plan(5);
6
t.equal(crypto.randomBytes(10).length, 10);
7
- t.ok(crypto.randomBytes(10) instanceof Buffer);
+ t.ok(Buffer.isBuffer(crypto.randomBytes(10)))
8
crypto.randomBytes(10, function(ex, bytes) {
9
t.error(ex);
10
t.equal(bytes.length, 10);
11
- t.ok(bytes instanceof Buffer);
+ t.ok(Buffer.isBuffer(bytes))
12
t.end();
13
});
14
@@ -30,7 +30,7 @@ test('randomBytes seem random', function (t) {
30
31
var expected = 256/2
32
var smean = Math.sqrt(mean)
33
-
+ console.log(expected - smean, mean, expected + smean)
34
t.ok(mean < expected + smean)
35
t.ok(mean > expected - smean)
36
0 commit comments