Methods Summary |
---|
public byte[] | calculateHash(byte[] bytes)Calculate the SHA-1 hash for the given bytes.
ByteBuffer buff = ByteBuffer.wrap( bytes );
return calculateHash( buff );
|
public byte[] | calculateHash(java.nio.ByteBuffer buffer)Calculate the SHA-1 hash for the given buffer.
sha1.reset();
return sha1.digest( buffer );
|
public byte[] | getDigest()Finish the hash calculation.
return sha1.digest();
|
public void | reset()Resets the hash calculation.
sha1.reset();
|
public void | restoreHashState()Restore the hasher state from previous save.
sha1.restoreState();
|
public void | saveHashState()Save the current hasher state for later resuming.
sha1.saveState();
|
public void | update(byte[] data)Start or continue a hash calculation with the given data.
update( ByteBuffer.wrap( data ));
|
public void | update(byte[] data, int pos, int len)Start or continue a hash calculation with the given data,
starting at the given position, for the given length.
update( ByteBuffer.wrap( data, pos, len ));
|
public void | update(java.nio.ByteBuffer buffer)Start or continue a hash calculation with the given data.
sha1.update( buffer );
|