|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.core3.util.SHA1Hasher
public final class SHA1Hasher
SHA-1 hasher utility frontend.
Constructor Summary | |
---|---|
SHA1Hasher()
Create a new SHA1Hasher instance |
Method Summary | |
---|---|
byte[] |
calculateHash(byte[] bytes)
Calculate the SHA-1 hash for the given bytes. |
byte[] |
calculateHash(ByteBuffer buffer)
Calculate the SHA-1 hash for the given buffer. |
byte[] |
getDigest()
Finish the hash calculation. |
HashWrapper |
getHash()
|
void |
reset()
Resets the hash calculation. |
void |
restoreHashState()
Restore the hasher state from previous save. |
void |
saveHashState()
Save the current hasher state for later resuming. |
void |
update(byte[] data)
Start or continue a hash calculation with the given data. |
void |
update(byte[] data,
int pos,
int len)
Start or continue a hash calculation with the given data, starting at the given position, for the given length. |
void |
update(ByteBuffer buffer)
Start or continue a hash calculation with the given data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SHA1Hasher()
Method Detail |
---|
public byte[] calculateHash(byte[] bytes)
bytes
- data to hash
public byte[] calculateHash(ByteBuffer buffer)
buffer
- data to hash
public void update(byte[] data)
data
- inputpublic void update(byte[] data, int pos, int len)
data
- inputpos
- start positionlen
- lengthpublic void update(ByteBuffer buffer)
buffer
- data inputpublic byte[] getDigest()
public HashWrapper getHash()
public void reset()
public void saveHashState()
public void restoreHashState()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |