Uuid.nameUuidFromString constructor
Generates a name-based UUID from a string name.
Parameters:
namespace
: Namespace UUID for the namename
: String name to generate UUID from
Returns:
- A deterministic UUID based on the namespace and name string
This is a convenience method that converts the string name to UTF-8 bytes and calls nameUuidFromBytes.
Example
final uuid = Uuid.nameUuidFromString(Uuid.NAMESPACE_DNS, 'example.com');
print(uuid.version); // 5
Implementation
factory Uuid.nameUuidFromString(Uuid namespace, String name) {
return Uuid.nameUuidFromBytes(namespace, utf8.encode(name));
}