You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 05bd2a4
Browse filesBrowse the repository at this point in the historyBrowse files
thrownewaddress_error_1.AddressError('All bytes must be integers between 0 and 255');
351
-
}
352
-
}
361
+
common.assertByteArray(bytes,4,'IPv4',0);
353
362
returnthis.fromUnsignedByteArray(bytes);
354
363
}
355
364
/**
356
-
* Convert an unsigned byte array to an Address4 object
365
+
* Convert an unsigned byte array to an Address4 object. Throws
366
+
* `AddressError` unless given exactly 4 bytes, and rejects values outside
367
+
* 0 to 255 when parsing the resulting address.
368
+
*
369
+
* To convert from a Node.js `Buffer`, spread it:
370
+
* `Address4.fromUnsignedByteArray([...buf])`.
357
371
* @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)
358
372
* @returns {Address4}
359
373
*/
@@ -383,7 +397,8 @@ class Address4 {
383
397
returnthis.binaryZeroPad().slice(start,end);
384
398
}
385
399
/**
386
-
* Return the reversed ip6.arpa form of the address
400
+
* Return the reversed in-addr.arpa form of the address, e.g.
401
+
* `42.2.0.192.in-addr.arpa.` for `192.0.2.42`.
387
402
* @param {Object} options
388
403
* @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix
389
404
* @returns {String}
@@ -403,49 +418,49 @@ class Address4 {
403
418
* @returns {boolean}
404
419
*/
405
420
isMulticast(){
406
-
returnthis.isInSubnet(MULTICAST_V4);
421
+
returnthis.isHostInSubnet(MULTICAST_V4);
407
422
}
408
423
/**
409
424
* Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).
0 commit comments