Convert IP addresses to integers
Project description
ipy2d
A small library to convert IP addresses to integers
Usage
from ipy2d import convert
print(convert.from_4("127.0.0.1")) # -> 2130706433
print(convert.to_4(134744072)) # -> 8.8.8.8
print(convert.from_6("::1")) # -> 1
print(convert.to_6(1051570404137199630024704)) # -> 0000:0000:0000:dead:beef:0000:0000:0000
print(convert.to_6(1051570404137199630024704, compressed=True)) # -> ::dead:beef:0:0:0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ipy2d-0.0.7.tar.gz
(3.4 kB
view hashes)
Built Distribution
ipy2d-0.0.7-py3-none-any.whl
(3.9 kB
view hashes)