guid_hash_string


Description:


[ Version ( since = "1.2.5" ) ]
public string guid_hash_string (string str)

Returns a GUID for a given string.

This uses a hash and so even small differences in the str will produce radically different return values.

The default implementation is taken from RFC4122, Section 4.1.3; specifically using a type-5 SHA-1 hash with a DNS namespace. The same result can be obtained with this simple python program:

#!/usr/bin/python import uuid print uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')

Parameters:

str

A source string to use as a key

Returns:

A new GUID, or null if the string was invalid


Namespace: Fwupd
Package: fwupd



2022 vala-language.org