|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.i2p.crypto.SHA256Generator
public final class SHA256Generator
Defines a wrapper for SHA-256 operation.
As of release 0.8.7, uses java.security.MessageDigest by default.
If that is unavailable, it uses
GNU-Crypto Sha256Standalone
| Constructor Summary | |
|---|---|
SHA256Generator(I2PAppContext context)
|
|
| Method Summary | |
|---|---|
Hash |
calculateHash(byte[] source)
Calculate the SHA-256 hash of the source and cache the result. |
Hash |
calculateHash(byte[] source,
int start,
int len)
Calculate the hash and cache the result. |
void |
calculateHash(byte[] source,
int start,
int len,
byte[] out,
int outOffset)
Use this if you only need the data, not a Hash object. |
static MessageDigest |
getDigestInstance()
Return a new MessageDigest from the system libs unless unavailable in this JVM, in that case return a wrapped GNU Sha256Standalone |
static SHA256Generator |
getInstance()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SHA256Generator(I2PAppContext context)
context - unused| Method Detail |
|---|
public static final SHA256Generator getInstance()
public final Hash calculateHash(byte[] source)
source - what to hash
public final Hash calculateHash(byte[] source,
int start,
int len)
public final void calculateHash(byte[] source,
int start,
int len,
byte[] out,
int outOffset)
out - needs 32 bytes starting at outOffsetpublic static MessageDigest getDigestInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||