ostore.util
Class SHA1HashBuffer

java.lang.Object
  |
  +--ostore.util.SecureHashBuffer
        |
        +--ostore.util.SHA1HashBuffer

public class SHA1HashBuffer
extends SecureHashBuffer

A SecureHashBuffer that produces SHA1Hashs.

Version:
$Id: SHA1HashBuffer.java,v 1.5 2002/04/01 18:27:30 geels Exp $
Author:
Dennis Geels
See Also:
SecureHashBuffer, SHA1Hash, MessageDigest

Constructor Summary
SHA1HashBuffer()
          Constructs a new SHA1HashBuffer.
 
Method Summary
 void add(byte input)
          Adds the specified byte to the digest.
 void add(byte[] input)
          Adds the specified byte array to the digest.
 void add(byte[] input, int offset, int length)
          Adds length bytes of the specified array to the digest, starting at offset.
 void add(Digestible input)
          Adds the specified object to the digest.
static void main(String[] args)
           
 SecureHash toHash()
          Computes and returns the digest of all inputs.
 
Methods inherited from class ostore.util.SecureHashBuffer
add, add, add, add, add
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHA1HashBuffer

public SHA1HashBuffer()
Constructs a new SHA1HashBuffer.
Method Detail

add

public void add(byte input)
Adds the specified byte to the digest.
Overrides:
add in class SecureHashBuffer

add

public void add(byte[] input)
Adds the specified byte array to the digest.
Overrides:
add in class SecureHashBuffer

add

public void add(byte[] input,
                int offset,
                int length)
Adds length bytes of the specified array to the digest, starting at offset.
Overrides:
add in class SecureHashBuffer

add

public void add(Digestible input)
Adds the specified object to the digest. This method invokes the input.add_to_digest method; be careful to avoid infinite loops.
Overrides:
add in class SecureHashBuffer

toHash

public SecureHash toHash()
Computes and returns the digest of all inputs. Also resets internal state, so do not attempt to produce intermediate hashes by calling this method prematurely.

This implementation always returns a SHA1Hash.

Overrides:
toHash in class SecureHashBuffer

main

public static void main(String[] args)