require("js-whatever/js/ip-pad")(ip) → {string}
Pads the components of an IPv4 address with leading zeros to allow them to be lexicographically sorted
Parameters:
| Name | Type | Description |
|---|---|---|
ip |
string | The IP address |
Returns:
The IP address with leading zeros
- Type
- string
Example
ipPad('93.184.216.119'); // returns 093.184.216.119
ipPad('10.7.14.241'); // returns 010.007.014.241