Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/beaugunderson/ip-address
/ functions
Functions
141 in github.com/beaugunderson/ip-address
⨍
Functions
141
◇
Types & classes
10
↓ 9 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:659
↓ 9 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:184
↓ 8 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:1282
↓ 6 callers
Method
bigInt
* Return the address as a BigInt * @returns {bigint}
src/ipv6.ts:879
↓ 6 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:361
↓ 6 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:175
↓ 5 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:721
↓ 5 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:85
↓ 5 callers
Method
getBitsBase2
* Return the bits in the given range as a base-2 string * @returns {String}
src/ipv6.ts:590
↓ 5 callers
Method
getType
* Return the type of the address * @returns {String}
src/ipv6.ts:567
↓ 4 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:863
↓ 4 callers
Method
fromUnsignedByteArray
* Convert an unsigned byte array to an Address6 object. * * To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...b
src/ipv6.ts:1164
↓ 4 callers
Method
getBitsBase16
* Return the bits in the given range as a base-16 string * @returns {String}
src/ipv6.ts:598
↓ 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:1249
↓ 3 callers
Method
bigInt
* Returns the address as a `bigint` * @returns {bigint}
src/ipv4.ts:264
↓ 3 callers
Function
escapeHtml
(s: string)
src/v6/helpers.ts:1
↓ 3 callers
Method
fromByteArray
* Convert a byte array to an Address6 object. * * To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`. * @retur
src/ipv6.ts:1154
↓ 3 callers
Method
getBits
* Return the bits in the given range as a BigInt * @returns {bigint}
src/ipv6.ts:582
↓ 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:1371
↓ 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:1354
↓ 3 callers
Method
isLinkLocal
* Returns true if the address is a link local address, false otherwise * @returns {boolean}
src/ipv6.ts:1211
↓ 3 callers
Method
isLoopback
* Returns true if the address is a loopback address, false otherwise * @returns {boolean}
src/ipv6.ts:1310
↓ 3 callers
Method
isMulticast
* Returns true if the address is a multicast address, false otherwise * @returns {boolean}
src/ipv6.ts:1232
↓ 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)) o
src/ipv6.ts:1337
↓ 3 callers
Method
isUnspecified
* Returns true if the address is the unspecified address `::`. * @returns {boolean}
src/ipv6.ts:1384
↓ 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:422
↓ 3 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:457
↓ 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:894
↓ 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:1124
↓ 2 callers
Method
_endAddress
* Helper function getting end address. * @returns {bigint}
src/ipv6.ts:475
↓ 2 callers
Method
_endAddress
* Helper function getting end address. * @returns {bigint}
src/ipv4.ts:299
↓ 2 callers
Method
_startAddress
* Helper function getting start address. * @returns {bigint}
src/ipv6.ts:448
↓ 2 callers
Method
_startAddress
* Helper function getting start address. * @returns {bigint}
src/ipv4.ts:272
↓ 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:520
↓ 2 callers
Method
endAddress
* The last address in the range given by this address' subnet * Often referred to as the Broadcast * @returns {Address6}
src/ipv6.ts:484
↓ 2 callers
Method
endAddressExclusive
* The last host address in the range given by this address's subnet ie * the last address prior to the Broadcast Address * @returns {Address6}
src/ipv6.ts:493
↓ 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:273
↓ 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:287
↓ 2 callers
Method
fromArpa
* Return an address from ip6.arpa form * @param {string} arpaFormAddress - an 'ip6.arpa' form address * @returns {Adress6} * @example * va
src/ipv6.ts:387
↓ 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:310
↓ 2 callers
Method
groupForV6
* Groups an IPv4 address for inclusion at the end of an IPv6 address * @returns {String}
src/ipv4.ts:531
↓ 2 callers
Function
groupPossibilities
(possibilities: string[])
src/v6/regular-expressions.ts:3
↓ 2 callers
Method
isCanonical
* Returns true if the address is in the canonical form, false otherwise * @returns {boolean}
src/ipv6.ts:1203
↓ 2 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:1261
↓ 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:1323
↓ 2 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:163
↓ 2 callers
Method
mask
* Returns the first n bits of the address, defaulting to the * subnet mask * @returns {String}
src/ipv4.ts:410
↓ 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:528
↓ 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:1518
↓ 2 callers
Function
renderSignature
(name: string, sig: TypeDoc.SignatureReflection)
scripts/build-readme.ts:32
↓ 2 callers
Function
renderType
(type: TypeDoc.SomeType | undefined)
scripts/build-readme.ts:28
↓ 2 callers
Function
sourceLink
(sources: SourceRef[] | undefined)
scripts/build-readme.ts:44
↓ 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:466
↓ 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:503
↓ 2 callers
Function
testBit
(binaryValue: string, position: number)
src/common.ts:94
↓ 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:1144
↓ 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:515
↓ 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
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:871
↓ 1 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:371
↓ 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:1048
↓ 1 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:198
↓ 1 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:209
↓ 1 callers
Method
fromUnsignedByteArray
* Convert an unsigned byte array to an Address4 object * @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255) * @returns {Address
src/ipv4.ts:396
↓ 1 callers
Method
getBitsBase2
* Returns the bits in the given range as a base-2 string * @returns {string}
src/ipv4.ts:422
↓ 1 callers
Method
getBitsPastSubnet
* Return the bits that are set past the subnet mask length * @returns {String}
src/ipv6.ts:614
↓ 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:540
↓ 1 callers
Method
group
* Groups an address * @returns {String}
src/ipv6.ts:1466
↓ 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:1408
↓ 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:1002
↓ 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:937
↓ 1 callers
Method
is6to4
* Returns true if the address is a 6to4 address, false otherwise * @returns {boolean}
src/ipv6.ts:1302
↓ 1 callers
Function
isBlocked
(host: string)
test/functionality-v6-test.ts:1379
↓ 1 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:1397
↓ 1 callers
Method
isTeredo
* Returns true if the address is a Teredo address, false otherwise * @returns {boolean}
src/ipv6.ts:1294
↓ 1 callers
Method
link
* Returns an HTML `<a>` element whose `href` encodes the address in a URL * hash fragment (default prefix `/#address=`). Useful for linking between
src/ipv6.ts:1426
↓ 1 callers
Function
loadJsonBatch
(addresses: AddressEntry[], classes: string[], noMerge?: boolean)
test/address-test.ts:189
↓ 1 callers
Function
main
()
scripts/build-readme.ts:138
↓ 1 callers
Method
microsoftTranscription
* Return the Microsoft UNC transcription of the address * @returns {String} the Microsoft UNC transcription of the address
src/ipv6.ts:413
↓ 1 callers
Function
notationsToAddresseses
(notations: string[])
test/functionality-v6-test.ts:10
↓ 1 callers
Function
notationsToAddresseses
(notations: string[])
test/functionality-v4-test.ts:8
↓ 1 callers
Function
numberToPaddedHex
(number: number)
src/common.ts:82
↓ 1 callers
Function
padGroup
(group: string)
src/v6/regular-expressions.ts:7
↓ 1 callers
Method
parse
(address: string)
src/ipv6.ts:783
↓ 1 callers
Method
parse
* Parses an IPv4 address string into its four octet groups and stores the * result on `this.parsedAddress`. Called automatically by the constructor
src/ipv4.ts:70
↓ 1 callers
Method
parse4in6
(address: string)
src/ipv6.ts:735
↓ 1 callers
Function
possibleElisions
( elidedGroups: number, moreLeft?: boolean, moreRight?: boolean, )
src/v6/regular-expressions.ts:50
↓ 1 callers
Method
possibleSubnets
(subnetSize: number = 128)
src/ipv6.ts:432
↓ 1 callers
Method
regularExpression
* Generate a regular expression that can be used to find or validate all * variations of this address. * @param {boolean} substringSearch * @
src/ipv6.ts:1572
↓ 1 callers
Function
renderClass
(cls: TypeDoc.DeclarationReflection)
scripts/build-readme.ts:79
↓ 1 callers
Function
renderMethod
(method: TypeDoc.DeclarationReflection)
scripts/build-readme.ts:51
↓ 1 callers
Function
renderProperty
(prop: TypeDoc.DeclarationReflection)
scripts/build-readme.ts:68
↓ 1 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:624
↓ 1 callers
Method
reverseForm
* Return the reversed ip6.arpa form of the address * @param {Object} options * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suf
src/ipv4.ts:432
↓ 1 callers
Function
simpleRegularExpression
(groups: string[])
src/v6/regular-expressions.ts:17
next →
1–100 of 141, ranked by callers