org.kde.koala

Class KMD5

public class KMD5 extends Object implements QtSupport

The default constructor is designed to provide much the same functionality as the most commonly used C-implementation, while the other three constructors are meant to further simplify the process of obtaining a digest by calculating the result in a single step. KMD5 is state-based, that means you can add new contents with update() as long as you didn't request the digest value yet. After the digest value was requested, the object is "finalized" and you have to call reset() to be able to do another calculation with it. The reason for this behavior is that upon requesting the message digest KMD5 has to pad the received contents up to a 64 byte boundary to calculate its value. After this operation it is not possible to resume consuming data. sage: A common usage of this class:
 String test1;
 KMD5.Digest rawResult;
 test1 = "This is a simple test.";
 KMD5 context (test1);
 cout << "Hex Digest output: " << context.hexDigest().data() << endl;
 
To cut down on the unnecessary overhead of creating multiple KMD5 objects, you can simply invoke reset() to reuse the same object in making another calculation:
 context.reset ();
 context.update ("TWO");
 context.update ("THREE");
 cout << "Hex Digest output: " << context.hexDigest().data() << endl;
 

Author: Dirk Mueller , Dawit Alemayehu

UNKNOWN: An adapted C++ implementation of RSA Data Securities MD5 algorithm.

Constructor Summary
protected KMD5(Class dummy)
KMD5()
KMD5(String in, int len)
Constructor that updates the digest for the given string.
KMD5(String in)
KMD5(byte[] a)
Method Summary
Stringbase64Digest()
Returns the value of the calculated message digest in a base64-encoded representation.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
protected voidfinalizeDigest()
finalizes the digest
StringhexDigest()
Returns the value of the calculated message digest in a hexadecimal representation.
voidhexDigest(StringBuffer arg1)
booleanisDisposed()
Has the wrapped C++ instance been deleted?
voidreset()
Calling this function will reset the calculated message digest.
voidupdate(String in, int len)
Updates the message to be digested.
voidupdate(String in)
voidupdate(short in, int len)
voidupdate(short in)
voidupdate(byte[] in)
booleanupdate(QIODevice file)
booleanverify(String arg1)

Constructor Detail

KMD5

protected KMD5(Class dummy)

KMD5

public KMD5()

KMD5

public KMD5(String in, int len)
Constructor that updates the digest for the given string.

Parameters: in C string or binary data len if negative, calculates the length by using strlen on the first parameter, otherwise it trusts the given length (does not stop on NUL byte).

UNKNOWN: Constructor that updates the digest for the given string.

KMD5

public KMD5(String in)

KMD5

public KMD5(byte[] a)

UNKNOWN: Same as above except it accepts a byte[] as its argument. @overload

Method Detail

base64Digest

public String base64Digest()
Returns the value of the calculated message digest in a base64-encoded representation.

UNKNOWN: Returns the value of the calculated message digest in a base64-encoded representation.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

finalizeDigest

protected void finalizeDigest()
finalizes the digest

UNKNOWN: finalizes the digest

hexDigest

public String hexDigest()
Returns the value of the calculated message digest in a hexadecimal representation.

UNKNOWN: Returns the value of the calculated message digest in a hexadecimal representation.

hexDigest

public void hexDigest(StringBuffer arg1)

UNKNOWN: @overload

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

reset

public void reset()
Calling this function will reset the calculated message digest. Use this method to perform another message digest calculation without recreating the KMD5 object.

UNKNOWN: Calling this function will reset the calculated message digest.

update

public void update(String in, int len)
Updates the message to be digested. Be sure to add all data before you read the digest. After reading the digest, you can not add more data!

Parameters: in message to be added to digest len the length of the given message.

UNKNOWN: Updates the message to be digested.

update

public void update(String in)

update

public void update(short in, int len)

UNKNOWN: @overload

update

public void update(short in)

update

public void update(byte[] in)

Parameters: in message to be added to the digest (byte[]).

UNKNOWN: @overload

update

public boolean update(QIODevice file)

Parameters: file a pointer to FILE as returned by calls like f{d,re}open

Returns: false if an error occurred during reading.

UNKNOWN: reads the data from an I/O device, i.e. from a file (QFile). NOTE that the file must be open for reading. @overload

verify

public boolean verify(String arg1)

UNKNOWN: @overload