hadiasghari / pyasn

Python IP address to Autonomous System Number lookup module. (Supports fast local lookups, and historical lookups using archived BGP dumps.)
Other
294 stars 72 forks source link

Implement integer IP input to .lookup() #59

Closed benjaminlaird closed 4 years ago

benjaminlaird commented 6 years ago

Hello, I'm curious if there is value in adding a second .lookup signature to support integer IPs. I'm using pyasn in a Spark job, looking up a large number of IPs in a job (1B+), where passing 32bit ints around the cluster will be very beneficial instead of string IPs.

I could convert in Python before calling .lookup() but doing the int->str conversion in the underlying C would obviously be faster.

Any interest in this? If so, I'd be willing to work on a PR.

hadiasghari commented 6 years ago

Hi @benjaminlaird. If you find the feature useful, and have the time to implement it, then by all means do it. I will gladly merge the PR :)

-Hadi