How to check if a given ip falls between a given ip range using node js

Viewed 13269

Please pardon for this trival question

Given a set of Ip the set is quite large and might increase https://github.com/client9/ipcat/blob/master/datacenters.csv#L4

Small example set - first column start ip second - end ip range

enter image description here

I will get the user ip from the request . I need to check if the ip falls in these set of ranges . How do i accomplish this.

I have looked into ip_range_check and range_check.

But they donot check for a ip given given range . How is thhis possible in node js with utmost performance. I dont want to go for a exhaustive search as performance is a hight priority.

Please help something new and quite challenging so far to me.

2 Answers
Related