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

Quick check for whether string is an IP, IPv4 or IPv6 #78

Closed
CMCDragonkai opened this issue May 23, 2021 · 3 comments
Closed

Quick check for whether string is an IP, IPv4 or IPv6 #78

CMCDragonkai opened this issue May 23, 2021 · 3 comments

Comments

@CMCDragonkai
Copy link

I know that the net node module can do this, but since this is the grand ip library for JavaScript, then perhaps these utility functions can be put here to avoid relying on Node functionality.

@CMCDragonkai
Copy link
Author

There's already function called isIPv4 but it isn't easy to use since you cannot just pass a string into it.

@dadepo
Copy link
Member

dadepo commented May 23, 2021

Hi @CMCDragonkai
You might want to check the Validator.isValidIPv4String and Validator.isValidIPv6String functions from the Validator module.

Let me know if these functions meet your need!

@CMCDragonkai
Copy link
Author

Those are great thanks.

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

2 participants