Skip to content

parseInetAtonIpv4Address

parseInetAtonIpv4Address(text): BitAddress

Defined in: packages/net-address/src/ipv4/parse-ipv4.ts:118

Parses the legacy C inet_aton grammar: one to four parts, each decimal, octal (leading 0) or hexadecimal (leading 0x), with the last part filling the remaining octets.

2130706433, 127.1 and 0177.0.0.1 all name 127.0.0.1 here. Never validate an allowlist with this. It exists so a caller reproducing what ping or a legacy configuration file accepts can do so deliberately, and so a security check can prove that a hostile string resolves to a blocked address under the lenient grammar too.

string

BitAddress

The address, 32 bits wide.

NetAddressSyntaxError When text is not an inet_aton form.