https://github.com/vasuadari/cidr
An Elixir package to calculate CIDR.
https://github.com/vasuadari/cidr
cidr elixir networking
Last synced: 8 months ago
JSON representation
An Elixir package to calculate CIDR.
- Host: GitHub
- URL: https://github.com/vasuadari/cidr
- Owner: vasuadari
- Created: 2020-01-25T12:02:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-25T13:06:35.000Z (over 6 years ago)
- Last Synced: 2024-10-09T13:02:12.151Z (over 1 year ago)
- Topics: cidr, elixir, networking
- Language: Elixir
- Homepage:
- Size: 1000 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CIDR

A simple package to calculate subnet mask, number of hosts, last address
and class of CIDR from a given CIDR notation.
## Installation
The package can be installed by adding `cidr` to your list of dependencies
in `mix.exs`:
```elixir
def deps do
[
{:cidr, github: "vasuadari/cidr"}
]
end
```
## Usage
```elixir
iex(1)> CIDR.parse("10.1.0.0/16")
{:ok,
%CIDR{
class: :B,
hosts: 65536,
last_address: "10.1.255.255",
subnet_mask: "255.255.0.0"
}}
```