com.compoze.collab.util
Class Sha1

java.lang.Object
  extended by com.compoze.collab.util.Sha1

public class Sha1
extends Object

This class is a port of the SHA-1 algorithm included with Mozilla.


Constructor Summary
Sha1()
          Constructor.
 
Method Summary
 byte[] digest()
          Complete the hash and get the final digest (resets internal state).
static void main(String[] args)
          Main.
 void reset()
          Resets the internal state to its initial values.
 void setBitCount(long lCount)
          Forces the bit count to be set to a particular value (should not use).
 void update(byte[] bytes)
          Adds more data to the hash.
 void update(byte[] bytes, int iOffset, int iLen)
          Adds more data to the hash.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sha1

public Sha1()
Constructor.

Method Detail

reset

public void reset()
Resets the internal state to its initial values.


update

public void update(byte[] bytes)
Adds more data to the hash.

Parameters
bytes - the data to add (not null)

update

public void update(byte[] bytes,
                   int iOffset,
                   int iLen)
Adds more data to the hash.

Parameters
bytes - the data to add (not null)
iOffset - the offset into the data
iLen - the length of the data

digest

public byte[] digest()
Complete the hash and get the final digest (resets internal state).

Returns
the completed digest

setBitCount

public void setBitCount(long lCount)
Forces the bit count to be set to a particular value (should not use).

Parameters
lCount - the new bit count

main

public static void main(String[] args)
                 throws Throwable
Main.

Throws
Throwable


Copyright © 2006 BEA Systems, Inc. All Rights Reserved