Parses the given IPv4 address into its octet representation.
The IPv4 address to parse, which can be in string, number, or octet array format.
An array of four numbers representing the octets of the IPv4 address.
import { ipv4 } from 'cidr-block';ipv4.parseOctets("192.168.1.1"); // [192, 168, 1, 1]ipv4.parseOctets(3232235777); // [192, 168, 1, 1]ipv4.parseOctets([10, 0, 0, 1]); // [10, 0, 0, 1] Copy
import { ipv4 } from 'cidr-block';ipv4.parseOctets("192.168.1.1"); // [192, 168, 1, 1]ipv4.parseOctets(3232235777); // [192, 168, 1, 1]ipv4.parseOctets([10, 0, 0, 1]); // [10, 0, 0, 1]
If the input is not a valid IPv4 address.
Parses the given IPv4 address into its octet representation.