public interface HASH
This is a slimmed-down version of MessageDigest
.
Several parts of the library will look up the implementation class to use in the configuration and then instantiate it using the no-argument constructor. The used algorithm names are only "md5" and "sha-1", for now.
The library includes default implementations of MD5 and SHA-1 based on Java's MessageDigest.
Modifier and Type | Method and Description |
---|---|
byte[] |
digest()
calculates and returns the digest for all the data
hashed up so far.
|
int |
getBlockSize()
returns the size of the hash which will be produced from input.
|
void |
init()
initializes the algorithm for new input data.
|
void |
update(byte[] foo,
int start,
int len)
Updates the algorithm with new data.
|
void init() throws Exception
update(byte[], int, int)
.Exception
int getBlockSize()
MessageDigest.getDigestLength()
void update(byte[] foo, int start, int len) throws Exception
foo
- an array containing new data to hash.start
- the index of the start of the data in foo
.len
- the length of the new added data.Exception
MessageDigest.update()
byte[] digest() throws Exception
getBlockSize()
.Exception
MessageDigest.digest()
This is an inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.