Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ninjakoala/cidr
- Owner: ninjakoala
- License: epl-1.0
- Created: 2015-01-02T09:08:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-27T15:25:05.000Z (about 2 years ago)
- Last Synced: 2024-08-10T21:28:53.772Z (6 months ago)
- Topics: cidr, clojure
- Language: Clojure
- Size: 18.6 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.