Interface Digest
- All Superinterfaces:
Component
- All Known Implementing Classes:
AbstractDigest,MD5Digest,SHA1Digest,SHA256Digest,SHA384Digest,SHA512Digest
A general interface for a digest with utility methods to add java types
into the digest.
- Author:
- Lee David Painter
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]doFinal()Do the final processing and return the hash.voidUpdate the digest with a BigInteger value.voidputByte(byte b) Put a single byte into the digest.voidputBytes(byte[] data) Put a byte array into the digest.voidputBytes(byte[] data, int offset, int len) Put a byte array into the digestvoidputInt(int i) Put an integer into the digest.voidPut a String into the digest.voidreset()Reset the underlying digest.
-
Method Details
-
putBigInteger
Update the digest with a BigInteger value. This puts both the integer length of the BigInteger data and the binary data.- Parameters:
bi-
-
putByte
void putByte(byte b) Put a single byte into the digest.- Parameters:
b-
-
putBytes
void putBytes(byte[] data) Put a byte array into the digest.- Parameters:
data-
-
putBytes
void putBytes(byte[] data, int offset, int len) Put a byte array into the digest- Parameters:
data-offset-len-
-
putInt
void putInt(int i) Put an integer into the digest.- Parameters:
i-
-
putString
Put a String into the digest.- Parameters:
str-
-
reset
void reset()Reset the underlying digest. -
doFinal
byte[] doFinal()Do the final processing and return the hash.- Returns:
- the hash
-