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
-
v5FromBytes(
String? namespace, Uint8List? name, {V5Options? config}) → String - Generates a namespace & name-based version 5 UUID from binary data
-
v5FromBytesBuffer(
String? namespace, Uint8List? name, List< int> ? buffer, {V5Options? config, int offset = 0}) → List<int> - Generates a namespace & name-based version 5 UUID from binary data into a provided buffer
-
v5FromBytesObj(
String? namespace, Uint8List? name, {V5Options? config}) → UuidValue - Generates a namespace & name-based version 5 UUID from binary data as a UuidValue object
-
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.strictRFC9562, bool noDashes = false}) → bool -
Validates the provided
uuidto 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. -
isValidUUIDFormat(
{String fromString = '', Uint8List? fromByteList, bool noDashes = false}) → bool - Validates that the input is exactly a 128-bit hexadecimal value.
-
parse(
String uuid, {List< int> ? buffer, int offset = 0, bool validate = true, ValidationMode validationMode = ValidationMode.strictRFC9562, bool noDashes = false}) → List<int> -
Parses the provided
uuidinto a list of byte values as a List<int>. Can optionally be provided abufferto write into and a positionaloffsetfor where to start inputting into the buffer. Throws FormatException if the UUID is invalid. Optionally you can setvalidateto false to disable validation of the UUID before parsing. SetnoDashestotruewhen parsing a 32-character UUID without dashes. -
parseAsByteList(
String uuid, {List< int> ? buffer, int offset = 0, bool validate = true, ValidationMode validationMode = ValidationMode.strictRFC9562, bool noDashes = false}) → Uint8List -
Parses the provided
uuidinto a list of byte values as a Uint8List. Can optionally be provided abufferto write into and a positionaloffsetfor where to start inputting into the buffer. Throws FormatException if the UUID is invalid. Optionally you can setvalidateto false to disable validation of the UUID before parsing. SetnoDashestotruewhen parsing a 32-character UUID without dashes. -
parseHex128(
String uuid, {List< int> ? buffer, int offset = 0, bool validate = true, bool noDashes = false}) → List<int> -
Parses the provided
uuidinto a list of byte values as a List<int>. Can optionally be provided abufferto write into and a positionaloffsetfor where to start inputting into the buffer. Throws FormatException if the hexadecimal format is invalid. UUID version and variant bits are not validated. Optionally you can setvalidateto false to disable validation of the UUID before parsing. SetnoDashestotruewhen parsing 32 hexadecimal characters without dashes. -
parseHex128AsByteList(
String uuid, {List< int> ? buffer, int offset = 0, bool validate = true, bool noDashes = false}) → Uint8List -
Parses the provided
uuidinto a list of byte values as a Uint8List. Can optionally be provided abufferto write into and a positionaloffsetfor where to start inputting into the buffer. Throws FormatException if the hexadecimal format is invalid. UUID version and variant bits are not validated. Optionally you can setvalidateto false to disable validation of the UUID before parsing. SetnoDashestotruewhen parsing 32 hexadecimal characters without dashes. -
unparse(
List< int> buffer, {int offset = 0}) → String -
Unparses a
bufferof bytes and outputs a proper UUID string. An optionaloffsetis 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