Skip to content

w3stling/checksum

Repository files navigation

Checksum

Build Download Javadoc License
CodeQL Quality Gate Coverage Bugs Vulnerabilities Code Smells

Note - from version 2.0.0:

  • New Java package name
  • New group ID in Maven / Gradle dependency declaration
  • Moved repository from JCenter to Maven Central Repository

Java library for calculating a checksum for a given resource. It can be either the content of a file or the content from a URL.

Examples

Calculates MD5 checksum for content of a file

String checksum = Checksum.calculate(new File("file.txt"), MessageDigest.getInstance("MD5"));

Calculates SHA-256 checksum for the content from a URL

String checksum = Checksum.calculate(new URI("http://google.com"), MessageDigest.getInstance("SHA-256"));

Download

Download the latest JAR or grab via Maven or Gradle.

Maven setup

Add dependency declaration:

<project>
    ...
    <dependencies>
        <dependency>
            <groupId>com.apptasticsoftware</groupId>
            <artifactId>checksum</artifactId>
            <version>2.1.9</version>
        </dependency>
    </dependencies>
    ...
</project>

Add dependency declaration:

dependencies {
    implementation 'com.apptasticsoftware:checksum:2.1.9'
}

Checksum library requires at minimum Java 11.

License

MIT License

Copyright (c) 2024, Apptastic Software

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.