Function

Fwupdguid_hash_data

Declaration [src]

gchar*
fwupd_guid_hash_data (
  const guint8* data,
  gsize datasz,
  FwupdGuidFlags flags
)

Description [src]

Returns a GUID for some data. This uses a hash and so even small differences in the data will produce radically different return values.

The implementation is taken from RFC4122, Section 4.1.3; specifically using a type-5 SHA-1 hash.

Available since:1.2.5

Parameters

data const guint8*
 

Data to hash.

 The data is owned by the caller of the function.
datasz gsize
 

Length of data.

flags FwupdGuidFlags
 

GUID flags, e.g. FWUPD_GUID_FLAG_NAMESPACE_MICROSOFT.

Return value

Returns: utf8
 

A new GUID, or NULL for internal error.

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