MCPcopy Create free account
hub / github.com/qiyeboy/IPProxyPool / str2ip

Method str2ip

test/testIPAddress.py:135–137  ·  view source on GitHub ↗
(self, s)

Source from the content-addressed store, hash-verified

133 return str(ip >> 24) + '.' + str((ip >> 16) & 0xff) + '.' + str((ip >> 8) & 0xff) + '.' + str(ip & 0xff)
134
135 def str2ip(self, s):
136 (ip,) = struct.unpack('I', socket.inet_aton(s))
137 return ((ip >> 24) & 0xff) | ((ip & 0xff) << 24) | ((ip >> 8) & 0xff00) | ((ip & 0xff00) << 8)
138
139 def getLong3(self, offset=0):
140 if offset:

Callers 1

testIPAddress.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected