MCPcopy
hub / github.com/qiyeboy/IPProxyPool / getString

Method getString

test/testIPAddress.py:120–130  ·  view source on GitHub ↗
(self, offset=0)

Source from the content-addressed store, hash-verified

118 return range
119
120 def getString(self, offset=0):
121 if offset:
122 self.ipdb.seek(offset)
123 str = b''
124 ch = self.ipdb.read(1)
125 (byte,) = struct.unpack('B', ch)
126 while byte != 0:
127 str += ch
128 ch = self.ipdb.read(1)
129 (byte,) = struct.unpack('B', ch)
130 return str.decode('gbk')
131
132 def ip2str(self, ip):
133 return str(ip >> 24) + '.' + str((ip >> 16) & 0xff) + '.' + str((ip >> 8) & 0xff) + '.' + str(ip & 0xff)

Callers 2

getAreaAddrMethod · 0.95
getAddrMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected