Skip to content
forked from Karm/CRC64Java

This is a Java wrapper for native CRC64 variant with "Jones" coefficients and init value of 0.

License

Notifications You must be signed in to change notification settings

whalebone/CRC64Java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRC64Java is a JNI wrapper for CRC64 native

Building

mvn install

Building under Windows

To build windows-x86_64 artifact under Windows install 'Build Tools for Visual Studio 2019' (installs nmake).

Build Maven crc64java-windows-x86_64 artifact in 'x64 Native Tools Command Prompt for VS 2019' shell.

Usage in your Java project

Add project repository and dependencies to your pom.xml. Use <artifactId>crc64java-mac-x86_64</artifactId> for Mac and <artifactId>crc64java-windows-x86_64</artifactId> for Windows.

<dependencies>
    <dependency>
        <groupId>biz.karms.crc64java</groupId>
        <artifactId>crc64java-java</artifactId>
        <version>1.0.9</version>
    </dependency>
    <dependency>
        <groupId>biz.karms.crc64java</groupId>
        <artifactId>crc64java-linux-x86_64</artifactId>
        <version>1.0.9</version>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>whalebone-github-mvn-repo</id>
        <url>https://raw.githubusercontent.com/whalebone/mvn-repo/master</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

Example

final CRC64 crc64 = CRC64.getInstance();

final BigInteger hash = crc64.crc64BigInteger("SOME DATA TO HASH".getBytes());
System.out.println(hash.toString());

final String hexHash = crc64.crc64Hex("SOME DATA TO HASH".getBytes());
System.out.println(hexHash);

Output:

11422352796240386699
9e84595997191a8b

Acknowledgments

  • CRC64 algorithm native implementation, Copyright (c) 2012, Salvatore Sanfilippo , All rights reserved.
  • CRC64Java JNI wrapper, based off Wildfly-OpenSSL approach to packaging shared objects, although projects are not related in any way. GNU GLP v3 license.
  • See COPYING.md for details

About

This is a Java wrapper for native CRC64 variant with "Jones" coefficients and init value of 0.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 48.3%
  • C 43.9%
  • Makefile 7.8%