Subnet
A library to create IPv4 subnetworks based on a given address and the number of hosts you want to connect.
✏️ Usage
use Ipv4Addr;
use ;
Output
Subnet address: 192.168.20.0
Bin subnet: 11000000101010000001010000000000
Broadcast: 192.168.20.127
Mask: /25
Useful range: [192.168.20.1 - 192.168.20.126]
📖 Add the library to your project
You can add the crate with cargo add
cargo add subnet
Alternatively, you can manually add it to your project's Cargo.toml like this:
[]
= "*" # Change the `*` to the current version
💻 Contributing
If you want to add new features to the libray, you need to follow this steps.
Clone this repository
git clone git@github.com:Pacatro/subnet.git
cd subnet
Run tests
cargo test
Run example
cargo run --example subnet