Hello.
/me responding to the bump;)
If you intend to calculate the sums for text buffers, use g_compute_checksum_for_string function, since you can ignore the length parameter if your string is NULL terminated (and most probably will be).
On the other hand, if you'll be calculating sum for some binary data, the length value will probably come with it, since there is no way of determining the size of the binary chunk. (If data will be read from disk, (f)read family of function returns some size indicator.)
Main point of all this is: if you have NULL terminated string, you don't need length parameter; if you're dealing with non-NULL terminated string or binary blob, there is no way to determine the length of the data and that value should be obtained at data creation (read) time.
BTW, g_strv_lenght has nothing to do with string lengths. This function is intended to be used with NULL-terminated arrays of strings (gchar **array or gchar *array[]) and returns number of strings in array.
Sample usage would be:
Code:
gchar *array[] = { "First string",
"Second string",
"Third string",
NULL };
g_print( "%d\n", g_strv_length( array ) );
This piece of code would print 3 to terminal.
Hope this helped a bit.