Browse Source

added util methods for coverting IP address

pull/18/merge
Rossen Georgiev 9 years ago
parent
commit
13ded88539
  1. 9
      steam/util/__init__.py

9
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]
Loading…
Cancel
Save