//#region src/internal/shared/ip.d.ts /** * Normalizes an IP address string for comparison.\ * IPv4 addresses pass through unchanged; IPv6 addresses expand to 8 * colon-separated zero-padded groups. * * @example * ```ts * normalizeIpAddress('::1'); * // '0000:0000:0000:0000:0000:0000:0000:0001' * ``` * * @param value IPv4 or IPv6 address string to normalize. * @returns The normalized address string. */ declare function normalizeIpAddress(value: string): string; /** * Parses an IPv4 or IPv6 address string into raw bytes.\ * Returns 4 bytes for IPv4 and 16 bytes for IPv6. * * Suitable for encoding into SAN iPAddress octets or name-constraint ranges. * * @example * ```ts * Array.from(parseIpAddressToBytes('127.0.0.1')); * // [127, 0, 0, 1] * ``` * * @param value IPv4 or IPv6 address string to parse. * @returns The raw address bytes. */ declare function parseIpAddressToBytes(value: string): Uint8Array; /** * Converts raw IP address bytes back to a human-readable string.\ * Returns dotted-decimal IPv4 for 4-byte input and colon-separated hex * IPv6 for 16-byte input. * * Throws on any other length. * * @example * ```ts * decodeIpAddress(Uint8Array.of(127, 0, 0, 1)); * // '127.0.0.1' * ``` * * @param bytes Raw IPv4 or IPv6 address bytes. * @returns The decoded address string. */ declare function decodeIpAddress(bytes: Uint8Array): string; /** * Returns an all-ones (`0xff`) mask of the appropriate length for the * given IP address string.\ * Returns 4 bytes for IPv4 and 16 bytes for IPv6. * * Used to build name-constraint subnet masks that match a single host. * * @example * ```ts * Array.from(allOnesMaskForIpAddress('127.0.0.1')); * // [255, 255, 255, 255] * ``` * * @param value IPv4 or IPv6 address string used to choose mask length. * @returns An all-ones mask for the same address family. */ declare function allOnesMaskForIpAddress(value: string): Uint8Array; //#endregion export { allOnesMaskForIpAddress, decodeIpAddress, normalizeIpAddress, parseIpAddressToBytes }; //# sourceMappingURL=ip.d.ts.map