Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 to Int or Long #123

Open
redimongo opened this issue Aug 31, 2022 · 0 comments
Open

IPv6 to Int or Long #123

redimongo opened this issue Aug 31, 2022 · 0 comments

Comments

@redimongo
Copy link

Hi I know we can do this for IPv4, but would be really helpful if there was away to do this with IPv6 as well.

ip.toLong('127.0.0.1'); // 2130706433

The reason is we want to do a query in our database that allows us to search if an IP address is greater or less than what we have stored in the Database. however we can't do that type of search with Strings and need to convert everything to int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant