Skip to content

Instantly share code, notes, and snippets.

View tosih's full-sized avatar
😰

Sohail Ahmed tosih

😰
View GitHub Profile
@tosih
tosih / parseCIDRRange.js
Created January 6, 2017 22:22 — forked from binarymax/parseCIDRRange.js
JavaScript function to parse a CIDR Range string into beginning and ending IPv4 Addresses
//MIT License
//Copyright (c) 2013, Max Irwin
//Parses a CIDR Range into beginning and ending IPv4 Addresses
//For example: '10.0.0.0/24'
//Returns ['10.0.0.0', '10.0.0.255']
var parseCIDR = function(CIDR) {
//Beginning IP address
var beg = CIDR.substr(CIDR,CIDR.indexOf('/'));