Skip to content

filip26/iridium-cbor-ld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iridium CBOR-LD

An implementation of the CBOR-LD 1.0 in Java.

Features

Status

Java 17 CI Codacy Badge Codacy Badge Maven Central License

CLI

LD-CLI is a command line utility for Ubuntu, Mac and Windows.

Usage

Encoding

// create an encoder builder initialized with default values
var encoder = CborLd.createEncoder()
               // use bundled static contexts (true by default)
               .useBundledContexts(true)
               // loader (optional)
               .loader(...)
               // custom terms dictionary (optional)
               .dictionary(customDictionary)
               // create a new encoder instance
               .build(); 
                   
// create barcodes encoder builder 
var encoder = CborLd.createEncoder(BarcodesConfig.INSTANCE)
               // ... customize
               .build()

// encode a document
byte[] encoded = encoder.encode(document);

Decoding

// create a decoder builder initialized with default values
var decoder = CborLd.createDecoder()
               // use bundled static contexts (true by default)
               .useBundledContexts(true)
               // loader (optional)
               .loader(...)
               // add custom terms dictionary (optional)
               .dictionary(customDictionary);
               // create a new decoder instance
               .build(); 
                   
// create barcodes decoder builder
var decoder = CborLd.createDecoder(BarcodesConfig.INSTANCE)
               // ... customize
               .build()
  
// decode
document = decoder.decode(encoded);

Backward Compatibility

// Iridium < v0.2.0
CborLd.create[Encoder|Decoder](V05Config.INSTANCE)
      // ... customize      
      .build();
      
// Iridium < v0.2.0, @digitalbazaar/cborld compatibility
CborLd.create[Encoder|Decoder](V05Config.INSTANCE)
      .compactArrays(false)
      // ... customize      
      .build();

Installation

Java 17+

<dependency>
    <groupId>com.apicatalog</groupId>
    <artifactId>iridium-cbor-ld</artifactId>
    <version>0.2.2</version>
</dependency>

Iridium CBOR-LD for Android is distributed under a commercial license. Contact

JSON-P Provider

Add JSON-P provider, if it is not on the classpath already.

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>jakarta.json</artifactId>
    <version>2.0.1</version>
</dependency>

Documentation

javadoc

Contributing

All PR's welcome!

Building

Fork and clone the project repository.

> cd iridium-cbor-ld
> mvn clean package

Resources

Sponsors

Commercial Support

Commercial support is available at filip26@gmail.com