https://github.com/ninjakoala/cidr
Clojure library for dealing with CIDR ranges
https://github.com/ninjakoala/cidr
cidr clojure
Last synced: 11 months ago
JSON representation
Clojure library for dealing with CIDR ranges
- Host: GitHub
- URL: https://github.com/ninjakoala/cidr
- Owner: ninjakoala
- License: epl-1.0
- Created: 2015-01-02T09:08:44.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-01-27T15:25:05.000Z (over 3 years ago)
- Last Synced: 2025-04-22T07:12:47.077Z (about 1 year ago)
- Topics: cidr, clojure
- Language: Clojure
- Size: 18.6 KB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://clojars.org/com.ninjakoala/cidr) [](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.