All Projects → m7shapan → cidr

m7shapan / cidr

Licence: MIT License
get more IP details from CIDR range

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to cidr

server-ip-addresses
Daily updated list of IP addresses / CIDR blocks used by data centers, cloud service providers, servers, etc.
Stars: ✭ 74 (+196%)
Mutual labels:  ip, cidr
lua-resty-ipcidr
A simple and very fast function to check against CIDR
Stars: ✭ 17 (-32%)
Mutual labels:  ip, cidr
ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
Stars: ✭ 212 (+748%)
Mutual labels:  ip, cidr
is-cidr
Check if a string is an IP address in CIDR notation
Stars: ✭ 27 (+8%)
Mutual labels:  ip, cidr
Aggregator
A stand-alone class implementation of the IPv4+IPv6 IP+CIDR aggregator from CIDRAM.
Stars: ✭ 19 (-24%)
Mutual labels:  ip, cidr
flip
Simple, lightweight, virtual IP management utility for moving IPs around nodes in response to cluster events.
Stars: ✭ 23 (-8%)
Mutual labels:  ip
swift-ipify
Swift library for checking your IP address from ipify.org
Stars: ✭ 37 (+48%)
Mutual labels:  ip
requests-ip-rotator
A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.
Stars: ✭ 323 (+1192%)
Mutual labels:  ip
Ip
🌏根据IpV4、IpV6地址获取定位信息的PHP🐘组件 PHP components that obtain location information based on IpV4, IpV6 addresses
Stars: ✭ 23 (-8%)
Mutual labels:  ip
network-pipeline
Network traffic data pipeline for real-time predictions and building datasets for deep neural networks
Stars: ✭ 36 (+44%)
Mutual labels:  ip
ebook
Third edition of the Computer Networking: Principles, Protocols and Practice ebook
Stars: ✭ 64 (+156%)
Mutual labels:  ip
findip
🔧 Python Script For Finding All Available Local IP Addresses
Stars: ✭ 38 (+52%)
Mutual labels:  ip
IpProxyPool
Golang 实现的 IP 代理池, 涉及到的技术点: go gorm proxy proxypool ip crawler 爬虫 mysql viper cobra
Stars: ✭ 36 (+44%)
Mutual labels:  ip
NullRAT
Your next stealthy Remote Access Trojan
Stars: ✭ 104 (+316%)
Mutual labels:  ip
omegleip
Shows the IP and Geolocation of the stranger. Written in Javascript as a Extension
Stars: ✭ 33 (+32%)
Mutual labels:  ip
ipd
查询ip地理信息,多种查询模式,高效,具有缓存机制,并可使用elasticsearch构建自己的ip数据库
Stars: ✭ 24 (-4%)
Mutual labels:  ip
tutti-quanti-shelf
Collection of miscellaneous developer-oriented utilities wrapped into one single app, built with Electron.
Stars: ✭ 30 (+20%)
Mutual labels:  cidr
jqIpLocation
jqIpLocation – jQuery Plugin that returns the location of an IP address in JSON format
Stars: ✭ 18 (-28%)
Mutual labels:  ip
UserDeviceTracker
快速定位一个IP或MAC在你的网络中的位置,是网络工程师提高工作效率的利器,也可以为CMDB提供基础网络数据。
Stars: ✭ 36 (+44%)
Mutual labels:  ip
ip scan
Scan a list of IPs quickly using multithreading
Stars: ✭ 13 (-48%)
Mutual labels:  ip

CIDR (Classless inter-domain routing)

This Package converts IP CIDR to range and return First IP, Last IP, First IP decimal, Last IP decimal and Total Host count for IPv4 and IPv6

Install

go get -u github.com/m7shapan/cidr

How to use

See the GoDoc

package main

import (
	"fmt"
	"log"

	"github.com/m7shapan/cidr"
)

func main() {
	p, err := cidr.ParseCIDR("1.0.0.0/24")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("First IP:", p.FirstIP)
	if p.IsIPv4 {
		fmt.Println("First IP (Decimal):", p.FirstIPv4())
	} else {
		fmt.Println("First IP (Decimal):", p.FirstIPv6())
	}

	fmt.Println("Last IP:", p.LastIP)

	if p.IsIPv4 {
		fmt.Println("Last IP (Decimal):", p.LastIPv4())
	} else {
		fmt.Println("Last IP (Decimal):", p.LastIPv6())
	}

	if p.IsIPv4 {
		fmt.Println("Total Host:", p.HostCountIPv4())
	} else {
		fmt.Println("Total Host:", p.HostCountIPv6())
	}

	// First IP: 1.0.0.0
	// First IP (Decimal): 16777216
	// Last IP: 1.0.0.255
	// Last IP (Decimal): 16777471
	// Total Host: 256


	ip := net.ParseIP("1.0.0.0")
	fmt.Println(IPv4tod(ip)) // 16777216

	ip := net.ParseIP("2001:4860:4860::8888")
	fmt.Println(IPv6tod(ip)) // 42541956123769884636017138956568135816

	var i uint32 = 16777216
	fmt.Println(DtoIPv4(i)) // 1.0.0.0

	b := new(big.Int)
	b.SetString("42541956123769884636017138956568135816", 10)
	fmt.Println(DtoIPv6(b)) // 2001:4860:4860::8888

}

Package usage for SEO

  • get ip from ip range
  • convert ip range to ip
  • golang convert ip range to decimal
  • How to get first/last IP address of CIDR
  • Convert IP version 6 address to integer or decimal number
  • IPv4 to IP Decimal Conversion
  • ipv4 to decimal golang
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].