Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/beaugunderson/ip-address
/ functions
Functions
176 in github.com/beaugunderson/ip-address
⨍
Functions
176
◇
Types & classes
12
↓ 12 callers
Method
embeddedIPv4
* If this address embeds a routable IPv4 address — i.e. it is IPv4-mapped * (`::ffff:0:0/96`) or sits in the NAT64 well-known prefix (`64:ff9b::/96
src/ipv6.ts:1368
↓ 12 callers
Method
fromBigInt
* Convert a BigInt to a v6 address object. The value must be in the * range `[0, 2**128 - 1]`; otherwise `AddressError` is thrown. * @param {big
src/ipv6.ts:200
↓ 11 callers
Method
correctForm
* Returns the address in correct form, per * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros * stripped, the longest ru
src/ipv6.ts:717
↓ 8 callers
Method
bigInt
* Return the address as a BigInt * @returns {bigint}
src/ipv6.ts:946
↓ 8 callers
Method
fromBigInt
* Converts a BigInt to a v4 address object. The value must be in the * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown. * @param {big
src/ipv4.ts:409
↓ 7 callers
Method
fromHex
* Converts a hex string to an IPv4 address object. Accepts 8 hex digits * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`). *
src/ipv4.ts:189
↓ 6 callers
Method
binaryZeroPad
* Return a zero-padded base-2 string representation of the address * @returns {String} * @example * var address = new Address6('2001:4860:400
src/ipv6.ts:779
↓ 6 callers
Method
correctForm
* Returns the address in correct form: octets joined with `.` and any * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the *
src/ipv4.ts:100
↓ 5 callers
Method
canonicalForm
* Returns the canonical (fully expanded) form of the address: all 8 groups, * each padded to 4 hex digits, with no `::` collapsing * (e.g. `2001
src/ipv6.ts:930
↓ 5 callers
Method
getType
* Return the type of the address * @returns {String}
src/ipv6.ts:625
↓ 4 callers
Method
bigInt
* Returns the address as a `bigint` * @returns {bigint}
src/ipv4.ts:278
↓ 4 callers
Method
fromByteArray
* Convert a byte array to an Address6 object. * * Accepts unsigned bytes (0 to 255) or signed bytes (-128 to 127, as an * `Int8Array` or a Ja
src/ipv6.ts:1230
↓ 4 callers
Method
fromUnsignedByteArray
* Convert an unsigned byte array to an Address6 object. * * Throws `AddressError` unless given exactly 16 integers from 0 to 255. * * To c
src/ipv6.ts:1247
↓ 4 callers
Method
getBitsBase16
* Return the bits in the given range as a base-16 string * @returns {String}
src/ipv6.ts:656
↓ 4 callers
Method
getBitsBase2
* Return the bits in the given range as a base-2 string * @returns {String}
src/ipv6.ts:648
↓ 4 callers
Method
is4
* Returns true if the address was written in v4-in-v6 dotted-quad notation * (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level f
src/ipv6.ts:1335
↓ 4 callers
Method
isLinkLocal
* Returns true if the address is a link-local unicast address in `fe80::/10` * ([RFC 4291 §2.4](https://datatracker.ietf.org/doc/html/rfc4291#secti
src/ipv6.ts:1305
↓ 4 callers
Method
isLoopback
* Returns true if the address is a loopback address, false otherwise * @returns {boolean}
src/ipv6.ts:1396
↓ 4 callers
Method
isMulticast
* Returns true if the address is a multicast address, false otherwise * @returns {boolean}
src/ipv6.ts:1318
↓ 4 callers
Method
isUnspecified
* Returns true if the address is the unspecified address `::`. * @returns {boolean}
src/ipv6.ts:1478
↓ 4 callers
Method
startAddress
* The first address in the range given by this address' subnet * Often referred to as the Network Address. * @returns {Address6}
src/ipv6.ts:477
↓ 3 callers
Method
_endAddress
* Helper function getting end address. * @returns {bigint}
src/ipv6.ts:495
↓ 3 callers
Method
_endAddress
* Helper function getting end address. * @returns {bigint}
src/ipv4.ts:347
↓ 3 callers
Method
endAddress
* The last address in the range given by this address's subnet. IPv6 has * no broadcast address, so this is an ordinary assignable address (in a
src/ipv6.ts:506
↓ 3 callers
Function
escapeHtml
(s: string)
src/v6/helpers.ts:1
↓ 3 callers
Method
getBits
* Return the bits in the given range as a BigInt * @returns {bigint}
src/ipv6.ts:640
↓ 3 callers
Method
isBroadcast
* Returns true if the address is an IPv4-mapped / NAT64 address whose embedded * IPv4 address is the limited broadcast address `255.255.255.255`
src/ipv6.ts:1465
↓ 3 callers
Method
isCGNAT
* Returns true if the address is an IPv4-mapped / NAT64 address whose embedded * IPv4 address is in the carrier-grade NAT range `100.64.0.0/10`
src/ipv6.ts:1448
↓ 3 callers
Method
isGlobal
* Returns true if the address is globally reachable: inside the global * unicast allocation `2000::/3` (the only range the [IANA IPv6 Address Space
src/ipv6.ts:1531
↓ 3 callers
Method
isMapped4
* Returns true if the address is an IPv4-mapped IPv6 address in * `::ffff:0:0/96` ([RFC 4291 §2.5.5.2](https://datatracker.ietf.org/doc/html/rfc429
src/ipv6.ts:1347
↓ 3 callers
Method
isPrivate
* Returns true if the address is private, i.e. a Unique Local Address in * `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)),
src/ipv6.ts:1431
↓ 3 callers
Method
isValid
* Returns true if the given string is a valid IPv6 address (with optional * CIDR subnet and zone identifier), false otherwise. Host bits in the
src/ipv6.ts:179
↓ 3 callers
Method
mask
* Return the first n bits of the address, defaulting to the subnet mask * @param {number} [mask=subnet] - the number of bits to mask * @returns
src/ipv6.ts:442
↓ 3 callers
Function
renderType
(type: TypeDoc.SomeType | undefined)
scripts/build-readme.ts:28
↓ 3 callers
Function
summaryFor
(reflection: TypeDoc.Reflection)
scripts/build-readme.ts:18
↓ 3 callers
Method
to4
* Return the last two groups of this address as an IPv4 address string. * If this address carries a CIDR prefix that covers the trailing 32 bits
src/ipv6.ts:961
↓ 3 callers
Method
toByteArray
* Return a byte array. * * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`. * @returns {Array}
src/ipv6.ts:1193
↓ 2 callers
Method
_startAddress
* Helper function getting start address. * @returns {bigint}
src/ipv6.ts:468
↓ 2 callers
Method
_startAddress
* Helper function getting start address. * @returns {bigint}
src/ipv4.ts:286
↓ 2 callers
Function
assert
(condition: any)
src/ipv6.ts:19
↓ 2 callers
Method
binaryZeroPad
* Returns a zero-padded base-2 string representation of the address * @returns {string}
src/ipv4.ts:615
↓ 2 callers
Function
csv_path
(version)
scripts/gen-iana-corpus.py:33
↓ 2 callers
Method
endAddressExclusive
* The address one before {@link endAddress}. This is the IPv6 counterpart * of the IPv4 method that skips the broadcast address; IPv6 has no broadc
src/ipv6.ts:517
↓ 2 callers
Function
escapeHtml
(text: string)
scripts/build-readme.ts:98
↓ 2 callers
Method
fromAddress4
* Create an IPv6-mapped address given an IPv4 address * @param {string} address - An IPv4 address string * @returns {Address6} * @example
src/ipv6.ts:389
↓ 2 callers
Method
fromAddressAndMask
* Construct an `Address6` from an address and a hex subnet mask given as * separate strings (e.g. as returned by Node's `os.networkInterfaces()`).
src/ipv6.ts:292
↓ 2 callers
Method
fromAddressAndWildcardMask
* Construct an `Address6` from an address and a Cisco-style wildcard mask * given as separate strings (e.g. `::ffff:ffff:ffff:ffff` for a `/64`).
src/ipv6.ts:306
↓ 2 callers
Method
fromArpa
* Return an address from ip6.arpa form. A full 32-nibble name gives a /128 * address; a shorter name, as used for a delegated reverse zone, gives t
src/ipv6.ts:409
↓ 2 callers
Method
fromInteger
* Converts an integer into a IPv4 address object. The integer must be a * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise * `
src/ipv4.ts:212
↓ 2 callers
Method
fromURL
* Parse a URL (with optional bracketed host and port) into an address and * port. Returns either `{ address, port }` on success or * `{ error, a
src/ipv6.ts:225
↓ 2 callers
Method
fromWildcard
* Construct an `Address6` from a wildcard pattern with trailing `*` * groups. The number of trailing wildcards determines the prefix * length: e
src/ipv6.ts:328
↓ 2 callers
Method
groupForV6
* Groups an IPv4 address for inclusion at the end of an IPv6 address. * * Returns an HTML fragment: each half of the address is wrapped in a
src/ipv4.ts:631
↓ 2 callers
Function
groupPossibilities
(possibilities: string[])
src/v6/regular-expressions.ts:3
↓ 2 callers
Method
isBenchmarking
* Returns true if the address is in the benchmarking range `2001:2::/48` * ([RFC 5180](https://datatracker.ietf.org/doc/html/rfc5180)) or is an
src/ipv6.ts:1502
↓ 2 callers
Method
isCanonical
* Returns true if the address is in the canonical form, false otherwise * @returns {boolean}
src/ipv6.ts:1294
↓ 2 callers
Method
isDocumentation
* Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)). * @return
src/ipv6.ts:1491
↓ 2 callers
Method
isULA
* Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 e
src/ipv6.ts:1409
↓ 2 callers
Method
mask
* Returns the first n bits of the address, defaulting to the * subnet mask * @returns {String}
src/ipv4.ts:457
↓ 2 callers
Method
networkForm
* The network address in CIDR string form, e.g. `2001:db8::/32` for * `2001:db8::1/32`. For an address with no explicit subnet the prefix * is `
src/ipv6.ts:586
↓ 2 callers
Method
nextNetwork
* Returns the network that follows this address's network: the address after * {@link endAddress}, with the same subnet mask. Throws `AddressError`
src/ipv6.ts:546
↓ 2 callers
Method
offset
* Returns the address `n` addresses after this one (or before, when `n` is * negative), keeping this address's subnet mask. Throws `AddressError` w
src/ipv6.ts:532
↓ 2 callers
Function
python_view
(address)
scripts/gen-iana-corpus.py:85
↓ 2 callers
Method
regularExpressionString
* Generate a regular expression string that can be used to find or validate * all variations of this address * @param {boolean} substringSearch
src/ipv6.ts:1665
↓ 2 callers
Function
renderParams
(sig: TypeDoc.SignatureReflection)
scripts/build-readme.ts:32
↓ 2 callers
Function
renderSignature
(name: string, sig: TypeDoc.SignatureReflection)
scripts/build-readme.ts:47
↓ 2 callers
Method
reverseForm
* Return the reversed ip6.arpa form of the address * @param {Object} options * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix
src/ipv6.ts:682
↓ 2 callers
Function
sourceLink
(sources: SourceRef[] | undefined)
scripts/build-readme.ts:61
↓ 2 callers
Function
spanLeadingZeroesSimple
(group: string)
src/v6/helpers.ts:31
↓ 2 callers
Method
startAddressExclusive
* The first host address in the range given by this address's subnet ie * the first address after the Network Address * @returns {Address6}
src/ipv6.ts:486
↓ 2 callers
Method
subnetMaskAddress
* The hex form of the subnet mask, e.g. `ffff:ffff:ffff:ffff::` for a * `/64`. Returns an `Address6`; call `.correctForm()` for the string. * @r
src/ipv6.ts:561
↓ 2 callers
Function
testBit
(binaryValue: string, position: number)
src/common.ts:192
↓ 2 callers
Method
to4in6
* Return the v4-in-v6 form of the address * @returns {String}
src/ipv6.ts:985
↓ 2 callers
Method
toHex
* Converts an IPv4 address object to a hex string * @returns {String}
src/ipv4.ts:241
↓ 2 callers
Method
toUnsignedByteArray
* Return an unsigned byte array. * * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`. * @returns {Ar
src/ipv6.ts:1212
↓ 2 callers
Method
wildcardMask
* The Cisco-style wildcard mask, e.g. `::ffff:ffff:ffff:ffff` for a * `/64`. This is the bitwise inverse of `subnetMaskAddress()`. Returns * an
src/ipv6.ts:573
↓ 2 callers
Method
withSubnetMask
(subnetMask: number)
src/ipv6.ts:552
↓ 2 callers
Method
withSubnetMask
(subnetMask: number)
src/ipv4.ts:339
↓ 1 callers
Function
addCommas
(number: string)
src/ipv6.ts:25
↓ 1 callers
Function
addressIs
(addressString: string, descriptors: string[])
test/address-test.ts:18
↓ 1 callers
Function
allocation
(address, space)
scripts/gen-iana-corpus.py:109
↓ 1 callers
Function
compact
(address: string[], slice: number[])
src/ipv6.ts:45
↓ 1 callers
Method
decimal
* Return the decimal form of the address * @returns {String}
src/ipv6.ts:938
↓ 1 callers
Function
entry
(address, blocks, family, space)
scripts/gen-iana-corpus.py:113
↓ 1 callers
Function
fetch
()
scripts/gen-iana-corpus.py:37
↓ 1 callers
Function
firstSentence
(summary: string)
scripts/build-readme.ts:122
↓ 1 callers
Method
fromAddress4Nat64
* Embed an IPv4 address into a NAT64 IPv6 address using the encoding * defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). * T
src/ipv6.ts:1115
↓ 1 callers
Method
fromUnsignedByteArray
* Convert an unsigned byte array to an Address4 object. Throws * `AddressError` unless given exactly 4 bytes, and rejects values outside * 0 to
src/ipv4.ts:443
↓ 1 callers
Method
getBitsBase2
* Returns the bits in the given range as a base-2 string * @returns {string}
src/ipv4.ts:469
↓ 1 callers
Method
getBitsPastSubnet
* Return the bits that are set past the subnet mask length * @returns {String}
src/ipv6.ts:672
↓ 1 callers
Method
getScope
* Return the scope of the address. The 4-bit scope field * ([RFC 4291 §2.7](https://datatracker.ietf.org/doc/html/rfc4291#section-2.7)) * is onl
src/ipv6.ts:598
↓ 1 callers
Method
group
* Groups an address. * * Returns an HTML fragment: each group is wrapped in a `<span>` carrying * the group classes an address-inspector UI h
src/ipv6.ts:1613
↓ 1 callers
Method
href
* Returns the address as an HTTP URL with the host bracketed, e.g. * `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended, * e.
src/ipv6.ts:1550
↓ 1 callers
Function
inException
(address: Address4 | Address6)
test/iana-corpus-test.ts:62
↓ 1 callers
Method
inspect6to4
* Decodes the 6to4 tunneling fields embedded in this address. Returns the * 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for
src/ipv6.ts:1069
↓ 1 callers
Method
inspectTeredo
* Decodes the Teredo tunneling fields embedded in this address. Returns the * Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag
src/ipv6.ts:1006
↓ 1 callers
Method
is6to4
* Returns true if the address is a 6to4 address, false otherwise * @returns {boolean}
src/ipv6.ts:1388
↓ 1 callers
Function
isBlocked
(host: string)
test/functionality-v6-test.ts:1727
↓ 1 callers
Method
isMulticast
* Returns true if the given address is a multicast address * @returns {boolean}
src/ipv4.ts:518
↓ 1 callers
Method
isReserved
* Returns true if the address is in the reserved range `240.0.0.0/4` ([RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)), * which includes
src/ipv4.ts:592
↓ 1 callers
Method
isTeredo
* Returns true if the address is a Teredo address, false otherwise * @returns {boolean}
src/ipv6.ts:1380
next →
1–100 of 176, ranked by callers