| exo Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <exo/exo.h>
ExoMd5Digest;
ExoMd5Digest * exo_str_get_md5_digest (const gchar *contents);
gchar * exo_str_get_md5_str (const gchar *contents);
ExoMd5Digest * exo_md5_str_to_digest (const gchar *str_digest);
gchar * exo_md5_digest_to_str (const ExoMd5Digest *digest);
ExoMd5Digest * exo_md5_digest_dup (const ExoMd5Digest *digest);
void exo_md5_digest_free (ExoMd5Digest *digest);
guint exo_md5_digest_hash (gconstpointer digest);
gboolean exo_md5_digest_equal (gconstpointer digest1,
gconstpointer digest2);
This is an implementation 16-byte MD5 hash algorithm with some related utility functions.
typedef struct {
guchar digest[16];
} ExoMd5Digest;
Structure to represent a MD5 digest.
guchar |
the MD5 digest. |
ExoMd5Digest * exo_str_get_md5_digest (const gchar *contents);
Creates a binary MD5 digest of the string contents.
|
The string to create a digest of. |
Returns : |
A new binary MD5 digest. It should be freed
with exo_md5_digest_free() when no longer
needed.
|
gchar * exo_str_get_md5_str (const gchar *contents);
Creates a character array MD5 digestof the string
contents.
|
The string to create a digest of. |
Returns : |
A newly-allocated character array which
should be free with g_free() when no
longer needed.
|
ExoMd5Digest * exo_md5_str_to_digest (const gchar *str_digest);
Converts thq str_digest character array digest
into a binary digest.
|
The character array digest to convert. |
Returns : |
A newly allocated binary digest. It should
be freed with exo_md5_digest_free() when
no longer needed.
|
gchar * exo_md5_digest_to_str (const ExoMd5Digest *digest);
Converts the binary digest to an ASCII character array
digest. The result can be used as an ordinary C string.
|
The binary MD5 digest to convert. |
Returns : |
A newly-allocated character array which
should be freed with g_free() when no
longer needed.
|
ExoMd5Digest * exo_md5_digest_dup (const ExoMd5Digest *digest);
Duplicates the contents of the digest binary
MD5 digest.
|
The MD5 digest to copy. |
Returns : |
A new binary MD5 digest. It should
be freed with exo_md5_digest_free()
when no longer needed.
|
void exo_md5_digest_free (ExoMd5Digest *digest);
Frees the memory allocated for the MD5 binary
digest.
|
The MD5 digest to free. |
guint exo_md5_digest_hash (gconstpointer digest);
Gets the numeric hash of digest, for use
in GHashTable and GCache.
|
The ExoMd5Digest to hash. |
Returns : |
An unsigned integer hash of the digest; |
gboolean exo_md5_digest_equal (gconstpointer digest1,
gconstpointer digest2);
Tests the equality of digest1 and digest2, useful for GHashTable and
GCashe.
|
the first ExoMd5Digest to compare. |
|
the second ExoMd5Digest to compare. |
Returns : |
TRUE if both digests are equal, FALSE otherwise.
|