g_compute_checksum_for_string (
  GChecksumType checksum_type,
  const gchar* str,
  gssize length


Computes the checksum of a string.

The hexadecimal string returned will be in lower case.

Available since:2.16


checksum_type GChecksumType

A GChecksumType.

str const gchar*

The string to compute the checksum of.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
length gssize

The length of the string, or -1 if the string is null-terminated.

Return value

Returns: gchar*

The checksum as a hexadecimal string, or NULL if g_checksum_new() fails for checksum_type. The returned string should be freed with g_free() when done using it.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The return value can be NULL.
 The value is a NUL terminated UTF-8 string.