public class SHA1
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DIGEST_SIZE
size of a SHA-1 digest in octets
|
| Constructor and Description |
|---|
SHA1()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all data, use reset() to start again.
|
void |
finalize()
Finalizes the digest.
|
byte[] |
getDigest()
Retrieves the digest.
|
int |
getDigest(byte[] buf,
int nOfs)
Retrieves the digest into an existing buffer.
|
void |
reset()
Initializes (or resets) the hasher for a new session.
|
boolean |
selfTest()
Runs an integrity test.
|
java.lang.String |
toString()
makes a binhex string representation of the current digest
|
void |
update(byte bB)
Adds a single byte to the digest.
|
void |
update(byte[] data)
Deprecated.
use update(byte[], int, int) instead
|
void |
update(byte[] data,
int nOfs,
int nLen)
Adds a portion of a byte array to the digest.
|
void |
update(java.lang.String sData)
Deprecated.
don't use this method anymore (it's not clean), you might
want to try update(sData.getBytes()) instead
|
public static final int DIGEST_SIZE
public void clear()
public void reset()
public void update(byte bB)
bB - the byte to addpublic void update(byte[] data)
data - the data to addpublic void update(byte[] data,
int nOfs,
int nLen)
data - the data to addpublic void update(java.lang.String sData)
sData - the string to addpublic void finalize()
finalize in class java.lang.Objectpublic byte[] getDigest()
public int getDigest(byte[] buf,
int nOfs)
buf - buffer to store the digst intonOfs - where to write topublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean selfTest()