benbro / inet_cidr

CIDR erlang library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hex.pm version

inet_cidr

CIDR library for Erlang.

Based on the Elixir library InetCidr but rewritten so it can be easily used in an Erlang application without requiring Elixir.

Available on hex.pm as erl_cidr.

Usage

Parsing a CIDR string

1> inet_cidr:parse("192.168.0.0/16").
{{192,168,0,0},{192,168,255,255},16}
2> inet_cidr:parse("2001:abcd::/32").
{{8193,43981,0,0,0,0,0,0},
 {8193,43981,65535,65535,65535,65535,65535,65535},
 32}

About

CIDR erlang library

License:Other


Languages

Language:Erlang 100.0%