Function

Fwupdguid_hash_data

since: 1.2.5

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

Type: const guint8*

Data to hash.

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

Type: gsize

Length of data.

flags

Type: FwupdGuidFlags

GUID flags, e.g. FWUPD_GUID_FLAG_NAMESPACE_MICROSOFT.

Return value

Type: gchar*

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 value is a NUL terminated UTF-8 string.