Uuid class

uuid for Dart Author: Yulian Kuncheff Released under MIT License.

Constructors

Uuid({GlobalOptions? goptions})
Creates a new instance of the Uuid class. Optionally you can pass in a GlobalOptions object to set global options for all UUID generation. GlobalOptions.rng is a RNG class that returns a list of random bytes.
const

Properties

goptions → GlobalOptions?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
v1({Map<String, dynamic>? options, V1Options? config}) String
Generates a time-based version 1 UUID
v1buffer(List<int> buffer, {Map<String, dynamic>? options, V1Options? config, int offset = 0}) List<int>
Generates a time-based version 1 UUID into a provided buffer
v1obj({Map<String, dynamic>? options, V1Options? config}) UuidValue
Generates a time-based version 1 UUID as a UuidValue object
v4({Map<String, dynamic>? options, V4Options? config}) String
Generates a RNG version 4 UUID
v4buffer(List<int> buffer, {Map<String, dynamic>? options, V4Options? config, int offset = 0}) List<int>
Generates a RNG version 4 UUID into a provided buffer
v4obj({Map<String, dynamic>? options, V4Options? config}) UuidValue
Generates a RNG version 4 UUID as a UuidValue object
v5(String? namespace, String? name, {Map<String, dynamic>? options, V5Options? config}) String
Generates a namespace & name-based version 5 UUID
v5buffer(String? namespace, String? name, List<int>? buffer, {Map<String, dynamic>? options, V5Options? config, int offset = 0}) List<int>
Generates a namespace & name-based version 5 UUID into a provided buffer
v5obj(String? namespace, String? name, {Map<String, dynamic>? options, V5Options? config}) UuidValue
Generates a namespace & name-based version 5 UUID as a UuidValue object
v6({V6Options? config}) String
Generates a draft time-based version 6 UUID
v6buffer(List<int> buffer, {V6Options? config, int offset = 0}) List<int>
Generates a draft time-based version 1 UUID into a provided buffer
v6obj({V6Options? config}) UuidValue
Generates a draft time-based version 6 UUID as a UuidValue object
v7({V7Options? config}) String
Generates a draft time-based version 7 UUID as a UuidValue object
v7buffer(List<int> buffer, {V7Options? config, int offset = 0}) List<int>
Generates a draft time-based version 7 UUID into a provided buffer
v7obj({V7Options? config}) UuidValue
Generates a draft time-based version 7 UUID as a UuidValue object
v8({V8Options? config}) String
Generates a draft time-based version 8 UUID
v8buffer(List<int> buffer, {V8Options? config, int offset = 0}) List<int>
Generates a draft time-based version 8 UUID into a provided buffer
v8g({V8GenericOptions? config}) String
Generates a draft time-based version 8 UUID
v8gbuffer(List<int> buffer, {V8GenericOptions? config, int offset = 0}) List<int>
Generates a draft time-based version 8 UUID into a provided buffer
v8gobj({V8GenericOptions? config}) UuidValue
Generates a draft time-based version 8 UUID as a UuidValue object
v8obj({V8Options? config}) UuidValue
Generates a draft time-based version 8 UUID as a UuidValue object

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isValidUUID({String fromString = '', Uint8List? fromByteList, ValidationMode validationMode = ValidationMode.strictRFC4122, bool noDashes = false}) bool
Validates the provided uuid to make sure it has all the necessary components and formatting and returns a bool You can choose to validate from a string or from a byte list based on which parameter is passed.
parse(String uuid, {List<int>? buffer, int offset = 0, bool validate = true, ValidationMode validationMode = ValidationMode.strictRFC4122}) List<int>
Parses the provided uuid into a list of byte values as a List
parseAsByteList(String uuid, {List<int>? buffer, int offset = 0, bool validate = true, ValidationMode validationMode = ValidationMode.strictRFC4122}) Uint8List
Parses the provided uuid into a list of byte values as a Uint8List. Can optionally be provided a buffer to write into and a positional offset for where to start inputting into the buffer. Throws FormatException if the UUID is invalid. Optionally you can set validate to false to disable validation of the UUID before parsing.
unparse(List<int> buffer, {int offset = 0}) String
Unparses a buffer of bytes and outputs a proper UUID string. An optional offset is allowed if you want to start at a different point in the buffer. Throws an exception if the buffer does not have a length of 16

Constants

NAMESPACE_DNS → const String
NAMESPACE_NIL → const String
NAMESPACE_OID → const String
NAMESPACE_URL → const String
NAMESPACE_X500 → const String