markomafs / cidr

Clojure library for dealing with CIDR ranges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clojars Project Build Status

(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.

Acknowledgements

Massive thanks must go to Keith Irwin for allowing me to lift the original code 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.

About

Clojure library for dealing with CIDR ranges

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%