Coder Social home page Coder Social logo

Outside ipv4 range about node-geoip HOT 5 CLOSED

geoip-lite avatar geoip-lite commented on July 19, 2024
Outside ipv4 range

from node-geoip.

Comments (5)

lloydchang avatar lloydchang commented on July 19, 2024

Hi Dave (btmdave), thanks for reporting this. While I agree with you that error messages are helpful, I believe design choices of geoip-lite (speed over accuracy, speed over features, when compared to geoip package) intentionally forgoes transaction overhead of error messages processing. Lets see what Philip (bluesmoon) says when he chimes in. In the meantime, Dave, what are your thoughts on geoip-lite's design choices?

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

Hi @btmdave, my design choices were influenced pretty much what @lloydchang says. I use node-geoip to lookup several million IPs a day and cannot afford to throw in any conditions that would slow down the majority case (ie, valid IPs).

Secondly, there's not much I can do about an invalid IP regardless of why it's invalid.

Lastly, the current design makes it simpler from the caller's point of view. A caller simply needs to check if the return value is truthy or not, and if it's truthy, then use it. If I were to return an error, or throw an exception on a bad IP, this would make callers more complicated without any benefit (at least none that I see).

from node-geoip.

btmdave avatar btmdave commented on July 19, 2024

@bluesmoon, thank you for the response. I wasn't necessarily criticizing the design choice, it's just I was receiving the same problem for all valid IP's that I tested.

from node-geoip.

btmdave avatar btmdave commented on July 19, 2024

@bluesmoon , Just did a fresh install and it worked perfectly. I probably didn't have the correct data files. Thanks so much.

Is there any example of using the converter for the full maxmind db?

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

I don't have the full maxmind db, so don't know if the format is the same or not. The conversion scripts both print usage information if run without arguments. city data only works with IPv4 (since MaxMind doesn't have IPv6 data for cities). country converter detects whether it's looking at v4 or v6 and does the right thing.

from node-geoip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.