Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 740 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 740 Bytes

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();