All Projects → silverwind → is-cidr

silverwind / is-cidr

Licence: BSD-2-Clause license
Check if a string is an IP address in CIDR notation

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects
typescript
32286 projects

Projects that are alternatives of or similar to is-cidr

server-ip-addresses
Daily updated list of IP addresses / CIDR blocks used by data centers, cloud service providers, servers, etc.
Stars: ✭ 74 (+174.07%)
Mutual labels:  ip, cidr
lua-resty-ipcidr
A simple and very fast function to check against CIDR
Stars: ✭ 17 (-37.04%)
Mutual labels:  ip, cidr
ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
Stars: ✭ 212 (+685.19%)
Mutual labels:  ip, cidr
cidr
get more IP details from CIDR range
Stars: ✭ 25 (-7.41%)
Mutual labels:  ip, cidr
Aggregator
A stand-alone class implementation of the IPv4+IPv6 IP+CIDR aggregator from CIDRAM.
Stars: ✭ 19 (-29.63%)
Mutual labels:  ip, cidr
Cuteit
IP obfuscator made to make a malicious ip a bit cuter
Stars: ✭ 475 (+1659.26%)
Mutual labels:  module, ip
ipinfo
A wrapper around the ipinfo.io services
Stars: ✭ 51 (+88.89%)
Mutual labels:  ip
laravel-admin
Laravel Admin panel with theme , modules ,artisan commands and helper classess.Laravel admin boilerplate with theme and modules
Stars: ✭ 22 (-18.52%)
Mutual labels:  module
ui patterns
[NOTE] Development has moved to https://drupal.org/project/ui_patterns
Stars: ✭ 87 (+222.22%)
Mutual labels:  module
cloudflare-ddns
A script to update your Cloudflare DNS records at a glance.
Stars: ✭ 152 (+462.96%)
Mutual labels:  ip
terraform-aws-s3
Terraform module to create default S3 bucket with logging and encryption type specific features.
Stars: ✭ 22 (-18.52%)
Mutual labels:  module
ip
Validate if an ip address is public or private.
Stars: ✭ 15 (-44.44%)
Mutual labels:  ip
puppetlabs-java ks
Uses a combination of keytool and openssl to manage entries in a Java keystore
Stars: ✭ 34 (+25.93%)
Mutual labels:  module
googletranslate
Python Google Translate (using reverse-engineered public API, so free)
Stars: ✭ 67 (+148.15%)
Mutual labels:  module
terraform-aws-ecr
This terraform module is used to create ECR on AWS.
Stars: ✭ 20 (-25.93%)
Mutual labels:  module
nuxt-brotli
Nuxt.js module which compresses assets with Brotli compression algorithm using `iltorb` library for serving it with `ngx_brotli`
Stars: ✭ 19 (-29.63%)
Mutual labels:  module
puppetlabs-gce compute
native types for managing google compute instances
Stars: ✭ 16 (-40.74%)
Mutual labels:  module
puppetlabs-dism
No description or website provided.
Stars: ✭ 19 (-29.63%)
Mutual labels:  module
cohesity-powershell-module
This repository provides a PowerShell Module for Cohesity DataPlatform. https://cohesity.github.io/cohesity-powershell-module
Stars: ✭ 39 (+44.44%)
Mutual labels:  module
uzakel
Verimerkezleri Arası IP Engelleme Sistemi
Stars: ✭ 17 (-37.04%)
Mutual labels:  ip

is-cidr

Check if a string is an IP address in CIDR notation

Install

npm i is-cidr

Usage

const isCidr = require("is-cidr");

isCidr("192.168.0.1/24"); //=> 4
isCidr("1:2:3:4:5:6:7:8/64"); //=> 6
isCidr("10.0.0.0"); //=> 0
isCidr.v6("10.0.0.0/24"); //=> false

API

isCidr(input)

Check if input is a IPv4 or IPv6 CIDR address. Returns either 4, 6 (indicating the IP version) or 0 if the string is not a CIDR.

isCidr.v4(input)

Check if input is a IPv4 CIDR address. Returns a boolean.

isCidr.v6(input)

Check if input is a IPv6 CIDR address. Returns a boolean.

Related

  • cidr-regex - Regular expression for matching IP addresses in CIDR notation
  • is-ip - Check if a string is an IP address
  • ip-regex - Regular expression for matching IP addresses
  • cidr-tools - Tools to work with IPv4 and IPv6 CIDR network lists

License

© silverwind, distributed under BSD licence

Based on previous work by Felipe Apostol

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].