A CIDR processing library for Java. Supports IPv4 and IPv6
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.travis.yml
LICENSE
README.md
pom.xml

README.md

Orchard Build Status License

A CIDR processing library for Java. Supports IPv4 and IPv6 Addresses.

Installation

<dependency>
    <groupId>com.aaronbedra</groupId>
    <artifactId>orchard</artifactId>
    <version>0.2.0</version>
</dependency>

Usage

import com.aaronbedra.orchard.CIDR;

if (CIDR.valueOf("1.1.1.0/24").contains("1.1.1.2")) {
  // do stuff
} else {
  // do other stuff
}
import com.aaronbedra.orchard.CIDR;

int mask = CIDR.valueOf("1.1.1.0/24").getMask();