ostore.util
Class SHA1HashBuffer
java.lang.Object
|
+--ostore.util.SecureHashBuffer
|
+--ostore.util.SHA1HashBuffer
- public class SHA1HashBuffer
- extends SecureHashBuffer
A SecureHashBuffer
that produces SHA1Hash
s.
- Version:
- $Id: SHA1HashBuffer.java,v 1.5 2002/04/01 18:27:30 geels Exp $
- Author:
- Dennis Geels
- See Also:
SecureHashBuffer
,
SHA1Hash
,
MessageDigest
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SHA1HashBuffer
public SHA1HashBuffer()
- Constructs a new
SHA1HashBuffer
.
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)