store ip ranges in Redis

后端 未结 4 1947
失恋的感觉
失恋的感觉 2021-02-02 02:22

I have a lot of IP ranges of different providers. For example

P1: 192.168.1.10 - 192.168.1.50, 192.168.2.16 - 192.168.2.49,
P2: 17.36.15.34 - 17.36.15.255,
P3: .         


        
4条回答
  •  误落风尘
    2021-02-02 02:56

    This is similar to what Didier Spezia proposed, but we use begin range and end range in sorted set, because there may be "gaps".

    https://github.com/nmmmnu/GeoIP-Redis

提交回复
热议问题