Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.51 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.51 KB

Hex.pm Version Build Status

Setup

To use this library in your project, edit your mix.exs file and add cidr as a dependency:

defp deps do
  [
    {:cidr, ">= 0.2.0"}
  ]
end

Usage

Parse an IP address / CIDR:

iex(1)> cidr = "1.2.3.4/24" |> CIDR.parse
%CIDR{ip: {1, 2, 3, 4}, mask: 24}

Match against a CIDR:

iex(2)> cidr |> CIDR.match({1,2,3,100})
true
iex(3)> cidr |> CIDR.match({1,2,4,1})
false

Contribution Process

This project uses the C4.1 process for all code changes.

"Everyone, without distinction or discrimination, SHALL have an equal right to become a Contributor under the terms of this contract."

tl;dr

  1. Check for open issues or open a new issue to start a discussion around a feature idea or a bug
  2. Fork the cidr-elixir repository on Github to start making your changes
  3. Write a test which shows that the bug was fixed or that the feature works as expected
  4. Send a pull request and wait for it to be merged

License

MIT License.