def ip_to_int(ip): segments = ip.split('.') binary_str = ''.join(['{:08b}'.format(int(segment)) for segment in segments]) return int(binary_str, 2)
复制
测试
ip = "10.0.3.193" result = ip_to_int(ip) print(result # 输出 167773121
def ip_to_int(ip): segments = ip.split('.') binary_str = ''.join(['{:08b}'.format(int(segment)) for segment in segments]) return int(binary_str, 2)
复制
ip = "10.0.3.193" result = ip_to_int(ip) print(result # 输出 167773121
2024-08-27 09:08:17
2024-05-09 11:05:34
2024-06-06 10:06:47
2024-04-22 09:04:34
2024-03-29 15:03:20
2024-04-20 17:04:38
2024-05-10 08:05:15
2024-10-30 21:10:12