Document and guarantee hex digests will be returned in lower case.

See bug #574019

svn path=/trunk/; revision=7971
This commit is contained in:
Stefan Walter 2009-03-11 15:47:36 +00:00
parent c471e97d9a
commit a4d3d1f3c8
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-03-11 Stef Walter <stef@memberwebs.com>
* glib/gchecksum.c: Document and guarantee hex digests will
be returned in lower case. Fixes bug #574019
2009-03-02 Matthias Clasen <mclasen@redhat.com> 2009-03-02 Matthias Clasen <mclasen@redhat.com>
* configure.in: Bump version * configure.in: Bump version

View File

@ -31,6 +31,7 @@
#define IS_VALID_TYPE(type) ((type) >= G_CHECKSUM_MD5 && (type) <= G_CHECKSUM_SHA256) #define IS_VALID_TYPE(type) ((type) >= G_CHECKSUM_MD5 && (type) <= G_CHECKSUM_SHA256)
/* The fact that these are lower case characters is part of the ABI */
static const gchar hex_digits[] = "0123456789abcdef"; static const gchar hex_digits[] = "0123456789abcdef";
#define MD5_DATASIZE 64 #define MD5_DATASIZE 64
@ -1256,6 +1257,8 @@ g_checksum_update (GChecksum *checksum,
* Once this function has been called the #GChecksum can no longer be * Once this function has been called the #GChecksum can no longer be
* updated with g_checksum_update(). * updated with g_checksum_update().
* *
* The hexadecimal characters will be lower case.
*
* Return value: the hexadecimal representation of the checksum. The * Return value: the hexadecimal representation of the checksum. The
* returned string is owned by the checksum and should not be modified * returned string is owned by the checksum and should not be modified
* or freed. * or freed.
@ -1374,6 +1377,8 @@ g_checksum_get_digest (GChecksum *checksum,
* convenience wrapper for g_checksum_new(), g_checksum_get_string() * convenience wrapper for g_checksum_new(), g_checksum_get_string()
* and g_checksum_free(). * and g_checksum_free().
* *
* The hexadecimal string returned will be in lower case.
*
* Return value: the digest of the binary data as a string in hexadecimal. * Return value: the digest of the binary data as a string in hexadecimal.
* The returned string should be freed with g_free() when done using it. * The returned string should be freed with g_free() when done using it.
* *
@ -1409,6 +1414,8 @@ g_compute_checksum_for_data (GChecksumType checksum_type,
* *
* Computes the checksum of a string. * Computes the checksum of a string.
* *
* The hexadecimal string returned will be in lower case.
*
* Return value: the checksum as a hexadecimal string. The returned string * Return value: the checksum as a hexadecimal string. The returned string
* should be freed with g_free() when done using it. * should be freed with g_free() when done using it.
* *