davidmoten / jsmaz

Java port of smaz, a small string compression algorithm, supports UTF-8, on Maven Central

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsmaz


Maven Central
codecov

com.github.davidmoten.jsmaz is a Java port of the Smaz short string compression algorithm by Salvatore Sanfilippo and released as a C library at: https://github.com/antirez/smaz. This Java port was built using https://github.com/RyanAD/jsmaz and https://github.com/tmbo/scala-smaz/.

Status: in development

Features

  • supports UTF-8 character set
  • good test coverage
  • supports Java 8+

Getting started

Add this to your pom.xml:

<dependency>
  <groupId>com.github.davidmoten</groupId>
  <artifactId>jsmaz</artifactId>
  <version>VERSION_HERE</version>
</dependency>

Usage

String a = "this is a simple test";

// compress to 10 bytes
byte[] compressed = Smaz.compress(a);

// decompress, b will be the same as a
String b = Smaz.decompress(compressed);

About

Java port of smaz, a small string compression algorithm, supports UTF-8, on Maven Central

License:Apache License 2.0


Languages

Language:Java 100.0%