diff --git a/steam/util/__init__.py b/steam/util/__init__.py index e69de29..fd2fe60 100644 --- a/steam/util/__init__.py +++ b/steam/util/__init__.py @@ -0,0 +1,9 @@ +import struct +import socket + + +def ip_from_int(ip): + return socket.inet_ntoa(struct.pack(">L", ip)) + +def ip_to_int(ip): + return struct.unpack(">L", socket.inet_aton(ip))[0]