v5obj method

UuidValue v5obj(
  1. String? namespace,
  2. String? name, {
  3. @Deprecated('use config instead. Removal in 5.0.0') Map<String, dynamic>? options,
  4. V5Options? config,
})

Generates a namespace & name-based version 5 UUID as a UuidValue object

By default it will generate a string based on a provided uuid namespace and name, and will return a UuidValue object.

The namespace parameter is the UUID namespace (as a String). The name parameter is a String.

The first optional argument is an options map that takes various configuration options detailed in the readme. This is going to be eventually deprecated.

The second optional argument is a V5Options object that takes the same options as the options map. This is the preferred way to pass options.

http://tools.ietf.org/html/rfc4122.html#section-4.4

Example: UuidValue usage

uuidValue = uuid.v5obj(Uuid.NAMESPACE_URL, 'www.google.com');
// -> UuidValue(uuid: "c74a196f-f19d-5ea9-bffd-a2742432fc9c")

print(uuidValue) -> // -> 'c74a196f-f19d-5ea9-bffd-a2742432fc9c'
uuidValue.toBytes() -> // -> [...]

Implementation

UuidValue v5obj(String? namespace, String? name,
    {@Deprecated('use config instead. Removal in 5.0.0')
    Map<String, dynamic>? options,
    V5Options? config}) {
  return options != null
      ? UuidValue.fromString(v5(namespace, name, options: options))
      : UuidValue.fromString(v5(namespace, name, config: config));
}