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.
crypto.randomBytes()
1 parent c7bb730 commit 1653db1Copy full SHA for 1653db1
lib/Sender.js
@@ -6,6 +6,7 @@
6
7
var events = require('events')
8
, util = require('util')
9
+ , crypto = require('crypto')
10
, EventEmitter = events.EventEmitter
11
, ErrorCodes = require('./ErrorCodes')
12
, bufferUtil = require('./BufferUtil').BufferUtil
@@ -315,10 +316,5 @@ function getArrayBuffer(data) {
315
316
}
317
318
function getRandomMask() {
- return new Buffer([
319
- ~~(Math.random() * 255),
320
321
322
- ~~(Math.random() * 255)
323
- ]);
+ return crypto.randomBytes(4);
324
0 commit comments