jonelo.jacksum
Class JacksumAPI
java.lang.Object
jonelo.jacksum.JacksumAPI
public class JacksumAPI
extends java.lang.Object
This is the Jacksum Application Program Interface (API).
Use this API to get an instance of an algorithm and to
determine both the available algorithms and available encodings
for the checksum.
NAME
public static final String NAME
VERSION
public static final String VERSION
getAvailableAlgorithms
public static Map getAvailableAlgorithms()
Gets all available algorithms.
- a Map with key and value pairs, both are Strings
(the key can be used to feed the method getChecksumInstance(),
the value of the pair is the name of the algorithm
which can be used in a GUI for example)
getAvailableEncodings
public static Map getAvailableEncodings()
Gets all available encodings of a checksum.
- a Map with key and value pairs, both are Strings
(the key can be used to feed the method setEncoding(),
the value of the pair is a description of the encoding)
getChecksumInstance
public static AbstractChecksum getChecksumInstance(String algorithm)
throws NoSuchAlgorithmException
Gets an object of a checksum algorithm.
It always tries to use implementations from the Java API
algorithm
- code for the checksum algorithm
- a checksum algorithm object
getChecksumInstance
public static AbstractChecksum getChecksumInstance(String algorithm,
boolean alternate)
throws NoSuchAlgorithmException
Gets an object of a checksum algorithm.
algorithm
- code for the checksum algorithmalternate
- a pure Java implementation is preferred
- a checksum algorithm object
getName
public static final String getName()
determines the Name of this API.
- a String representing the Name of this API
getVersion
public static final Version getVersion()
Determines the Version of this API.
- a Version object representing the version of this API
getVersionString
public static final String getVersionString()
determines the Version of this API.
- a String representing the Version of this API
runCLI
public static void runCLI(String[] args)
runs the CLI