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 ba7a58b commit 25b25f6Copy full SHA for 25b25f6
lib/common-node.js
@@ -5,6 +5,8 @@
5
6
var querystring = require('querystring')
7
8
+var MAX_UINT = Math.pow(2, 32) - 1
9
+
10
exports.IPV4_RE = /^[\d\.]+$/
11
exports.IPV6_RE = /^[\da-fA-F:]+$/
12
@@ -25,6 +27,7 @@ exports.EVENT_NAMES = {
25
27
}
26
28
29
function toUInt32 (n) {
30
+ if (n > MAX_UINT) n = MAX_UINT
31
var buf = new Buffer(4)
32
buf.writeUInt32BE(n, 0)
33
return buf
0 commit comments