ostore.util
Class SHA1HashBuffer

java.lang.Object
  |
  +--ostore.util.OutputBufferImpl
        |
        +--ostore.util.SecureHashBuffer
              |
              +--ostore.util.SHA1HashBuffer
All Implemented Interfaces:
OutputBuffer

public class SHA1HashBuffer
extends SecureHashBuffer

A SecureHashBuffer that produces SHA1Hashs.

Version:
$Id: SHA1HashBuffer.java,v 1.13 2004/01/07 20:21:44 srhea 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, int offset, int length)
          Adds length bytes of the specified array to the digest, starting at offset.
static void main(String[] args)
           
 SecureHash toHash()
          Computes and returns the digest of all inputs.
 
Methods inherited from class ostore.util.OutputBufferImpl
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, 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.

Specified by:
add in interface OutputBuffer
Specified by:
add in class OutputBufferImpl

add

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

Specified by:
add in interface OutputBuffer
Specified by:
add in class OutputBufferImpl

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.

Specified by:
toHash in class SecureHashBuffer

main

public static void main(String[] args)