cidit-1.0.0 is not a library.
CIDR calculator for CLI
Calculate Network Ranges for a given CIDR.
For example, cidit 10.122.33.44/24 prints out the following information:
cidr first_usable last_usable subnet broadcast
10.122.33.44/24 10.122.33.1 10.122.33.254 10.122.33.0 10.122.33.255
CIDR stands for Classless Inter-Domain Routing. Learn more about CIDR here or here.
Install
With Homebrew (recommended)
brew tap hex22a/cidit
brew install cidit
Binaries
Check out Releases page to find binaries for Your platform
Usage
# cidit --help to get more usage info
cidit 10.122.33.44/24
Different output formats
cidit -f json 10.122.33.44/24
# Prints: {"cidr":"10.122.33.44/24","first_usable":"10.122.33.1","last_usable":"10.122.33.254","subnet":"10.122.33.0","broadcast":"10.122.33.255"}
or alternatively You can run it via cargo from the project root
cargo run -- 10.122.33.44/24
Compile from sources
Clone this repo:
git clone git@github.com:hex22a/cidit.git && cd ./cidit
Run tests:
cargo test
Build the binary
cargo build
This will create a binary in target > debug directory