Utilities
Class SHA12
- public final class SHA12
- This is a simple port of Steve Reid's SHA-1 code into Java. I've run his test vectors through the code and they all pass.
- Author:
- This class was obtained from Internet
update
public synchronized void update(byte[] input,
int offset,
int len)
- Add specific bytes to the digest.
update
public synchronized void update(byte[] input)
- Add an array of bytes to the digest.
updateASCII
public void updateASCII(java.lang.String input)
- Treat the string as a sequence of ISO-Latin1 (8 bit) characters.
transform
void transform()
- Hash a single 512-bit block. This is the core of the algorithm. Note that working with arrays is very inefficent in Java as it does a class cast check each time you store into the array.
init
public void init()
- SHA1Init - Initialize new context
update
public synchronized void update(byte b)
- Add one byte to the digest. When this is implemented all of the abstract class methods end up calling this method for types other than bytes.
finish
public void finish()
- Complete processing on the message digest.
getAlg
public java.lang.String getAlg()
- Return a string that identifies this algorithm
digout
public java.lang.String digout()
- Print out the digest in a form that can be easily compared to the test vectors.