Skip to content

Commit

Permalink
restore compatibility with node 0.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Běhan committed Jul 27, 2012
1 parent 1679fd5 commit a5c5c20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@ Manager.prototype.handleClient = function (data, req) {

Manager.prototype.generateId = function () {
var rand = new Buffer(15); // multiple of 3 for base64
if (!rand.writeInt32BE) {
return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString()
+ Math.abs(Math.random() * Math.random() * Date.now() | 0).toString();
}
this.sequenceNumber = (this.sequenceNumber + 1) | 0;
rand.writeInt32BE(this.sequenceNumber, 11);
if (crypto.randomBytes) {
Expand Down

0 comments on commit a5c5c20

Please sign in to comment.