62678d742abff72554d16dbc9067baae8e309f8f
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index dd57641..1fb2c91 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -2507,4 +2507,5 @@ g_checksum_type
 g_checksum_update
 g_checksum_get_string
 g_checksum_get_digest
+g_checksum_from_data
 </SECTION>
diff --git a/glib/gchecksum.c b/glib/gchecksum.c
index dd665c6..dc7162f 100644
--- a/glib/gchecksum.c
+++ b/glib/gchecksum.c
@@ -1345,5 +1345,43 @@ g_checksum_get_digest (GChecksum  *checksum,
   return retval;
 }
 
+/**
+ * g_checksum_from_data:
+ * @type: a #GChecksumType
+ * @data: a binary blob
+ * @length: length of the data
+ *
+ * Computes the checksum for @data using the algorithm @type. This is
+ * a convenience function for g_checksum_new(), g_checksum_update()
+ * and g_checksum_free().
+ *
+ * Return value: the checksum for the passed binary data, or %NULL. The
+ *   returned string should be freed with g_free() when done using it.
+ *
+ * Since: 2.16
+ */
+gchar *
+g_checksum_from_data (GChecksumType  type,
+                      const guchar  *data,
+                      gsize          length)
+{
+  GChecksum *checksum;
+  gchar *retval;
+
+  g_return_val_if_fail (data != NULL, NULL);
+  g_return_val_if_fail (length > 1, NULL);
+
+  checksum = g_checksum_new (type);
+  if (!checksum)
+    return NULL;
+
+  g_checksum_update (checksum, data, length);
+  retval = g_strdup (g_checksum_get_string (checksum));
+
+  g_checksum_free (checksum);
+
+  return retval;
+}
+
 #define __G_CHECKSUM_C__
 #include "galiasdef.c"
diff --git a/glib/gchecksum.h b/glib/gchecksum.h
index f64c1ff..6793f90 100644
--- a/glib/gchecksum.h
+++ b/glib/gchecksum.h
@@ -44,6 +44,10 @@ G_CONST_RETURN gchar *g_checksum_get_string (GChecksum        *checksum);
 gsize                 g_checksum_get_digest (GChecksum        *checksum,
                                              guint8          **digest);
 
+gchar *               g_checksum_from_data  (GChecksumType     type,
+                                             const guchar     *data,
+                                             gsize             length);
+
 G_END_DECLS
 
 #endif /* __G_CHECKSUM_H__ */
diff --git a/glib/glib.symbols b/glib/glib.symbols
index 9eea952..65100e8 100644
--- a/glib/glib.symbols
+++ b/glib/glib.symbols
@@ -180,6 +180,7 @@ g_checksum_type
 g_checksum_update
 g_checksum_get_string
 g_checksum_get_digest
+g_checksum_from_data
 #endif
 #endif
 
