Skip to content

Commit

Permalink
Merge pull request #18 from benatkin/patch-1
Browse files Browse the repository at this point in the history
Use Math.floor instead of parseInt when generating MACHINE_ID
  • Loading branch information
williamkapke committed Apr 2, 2018
2 parents fd1b9e6 + 15e272e commit 23d9c89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion objectid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var MACHINE_ID = parseInt(Math.random() * 0xFFFFFF, 10);
var MACHINE_ID = Math.floor(Math.random() * 0xFFFFFF);
var index = ObjectID.index = parseInt(Math.random() * 0xFFFFFF, 10);
var pid = (typeof process === 'undefined' || typeof process.pid !== 'number' ? Math.floor(Math.random() * 100000) : process.pid) % 0xFFFF;

Expand Down

0 comments on commit 23d9c89

Please sign in to comment.