Skip to content

0xflotus/ipy2d

Repository files navigation

ipy2d

ipy2d on pypi

A small library to convert IP addresses to integers

Usage

from ipy2d import *

print(from_4("127.0.0.1")) # -> 2130706433
print(to_4(134744072)) # -> 8.8.8.8

print(from_6("::1")) # -> 1
print(to_6(1051570404137199630024704)) # -> 0000:0000:0000:dead:beef:0000:0000:0000
print(to_6(1051570404137199630024704, compressed=True)) # -> ::dead:beef:0:0:0

About

A python library to convert IP addresses to integers

Resources

License

Stars

Watchers

Forks

Packages

No packages published