top | item 40841478

(no title)

jstasiak | 1 year ago

> Wouldn’t it be simpler and more consistent to have a first parse the IP into an internal format then perform all logic on that?

So not speaking about this library specifically but yes, separating the address parsing part (https://www.netmeister.org/blog/inet_aton.html is a fun read) from the "is this address considered private?" part should make things much simpler.

Vast majority of related code in this space that I've seen works like that. I'm actually struggling to come up with counterexamples.

discuss

order

No comments yet.