Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ninjakoala/cidr

Clojure library for dealing with CIDR ranges
https://github.com/ninjakoala/cidr

cidr clojure

Last synced: about 1 month ago
JSON representation

Clojure library for dealing with CIDR ranges

Awesome Lists containing this project

README

        

[![Clojars Project](https://img.shields.io/clojars/v/com.ninjakoala/cidr.svg)](https://clojars.org/com.ninjakoala/cidr) [![Build Status](https://travis-ci.org/ninjakoala/cidr.svg?branch=master)](https://travis-ci.org/ninjakoala/cidr)

```clojure
(ns your.namespace
(:require [cidr.core :as cidr]))

(cidr/in-range? "192.168.0.1" "192.168.0.0/24") ; => true
(cidr/in-range? "192.167.0.1" "192.168.0.0/24") ; => false

(cidr/completely-in-range? "192.168.0.0/24" "192.168.0.0/16") ; => true

(cidr/overlap? "192.168.0.1/25" "192.168.0.1/24") ; => true

```

# cidr

General utilities for dealing with [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing).

## Acknowledgements

Massive thanks must go to [Keith Irwin](https://github.com/zentrope) for allowing me to lift the [original code](https://github.com/zentrope/match-expr/blob/master/src/match_expr/impl/cidr.clj) and package it up in to a library.

## License

Copyright © 2015 Neil Prosser

Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.