All Packages Class Hierarchy This Package Previous Next Index
Class is.hi.logir.cryptonite.SHA1State
java.lang.Object
|
+----is.hi.logir.cryptonite.Cryptonite
|
+----is.hi.logir.cryptonite.FingerprintState
|
+----is.hi.logir.cryptonite.SHA1State
- public class SHA1State
- extends FingerprintState
An object of this class holds the state of a SHA-1 fingerprint still
being calculated.
This class actually uses java.security.MessageDigest to do all the work.
- Author:
- Logi Ragnarsson (logir@hi.is)
-
SHA1State()
- Create a new clear SHA1State.
-
blockSize()
- Return the number of bytes needed to make a valid hash.
-
calculate()
- Return a Fingerprint for the curret state, without
destroying the state.
-
getName()
- Return "SHA1".
-
hashSize()
- Returns the size of a fingerprint in bytes.
-
reset()
- Reset the object.
-
update(byte[], int, int)
- Update the fingerprint state with the bytes from
buf[offset, offset+length-1]
.
SHA1State
public SHA1State()
- Create a new clear SHA1State.
getName
public String getName()
- Return "SHA1".
- Overrides:
- getName in class FingerprintState
reset
public void reset()
- Reset the object.
- Overrides:
- reset in class FingerprintState
update
public void update(byte buffer[],
int offset,
int length)
- Update the fingerprint state with the bytes from
buf[offset, offset+length-1]
.
- Overrides:
- update in class FingerprintState
calculate
public Fingerprint calculate()
- Return a Fingerprint for the curret state, without
destroying the state.
- Overrides:
- calculate in class FingerprintState
blockSize
public int blockSize()
- Return the number of bytes needed to make a valid hash. If a multiple
of this number of bytes is hashed, no padding is needed. If no such
value exists, returns 0.
- Overrides:
- blockSize in class FingerprintState
hashSize
public int hashSize()
- Returns the size of a fingerprint in bytes.
- Overrides:
- hashSize in class FingerprintState
All Packages Class Hierarchy This Package Previous Next Index