# ip ==> 数字 >>> ip2num = lambda x:sum([256**j*int(i) for j,i in enumerate(x.split(‘.‘)[::-1])]) >>> ip2num(‘192.168.0.1‘) 3232235521
时间: 2025-01-17 00:03:06
# ip ==> 数字 >>> ip2num = lambda x:sum([256**j*int(i) for j,i in enumerate(x.split(‘.‘)[::-1])]) >>> ip2num(‘192.168.0.1‘) 3232235521