I want to efficiently search IPv6 subnet range using redis.
i thought of storing the IPv6 numeric addresses in redis and search them by range. those are 128-bit ints, e.g:
import ipaddress
int(ipaddress.ip_address(u'113f:a:2:3:4:1::77'))
> 22923991422715307029586104612626104439L
and query by range:
ZRANGEBYSCORE numerics <subnet-S-start> <subnet-S-end>
HOWEVER, redis sorted-sets can hold score of up to 2^53, so all my large ints are being trimmed and I'm losing precision.
Is there a way to save such large numbers in redis without losing precision?
Do you have a better suggestion? Thanks