Depiction Engine For Unity 2023.0 (Alpha)
Loading...
Searching...
No Matches
DepictionEngine.GuidUtility Class Reference

Helper methods for working with Guid. More...

Static Public Member Functions

static bool TryParse (string value, out Guid guid)
 Tries to parse the specified string as a Guid. A return value indicates whether the operation succeeded.
 
static string ToLowerNoDashString (this Guid guid)
 Converts a GUID to a lowercase string with no dashes.
 
static ? Guid TryFromLowerNoDashString (string value)
 Attempts to convert a lowercase, no dashes string to a GUID.
 
static Guid Create (Guid namespaceId, string name)
 Creates a name-based UUID using the algorithm from RFC 4122 §4.3.
 
static Guid Create (Guid namespaceId, string name, int version)
 Creates a name-based UUID using the algorithm from RFC 4122 §4.3.
 
static Guid Create (Guid namespaceId, byte[] nameBytes)
 Creates a name-based UUID using the algorithm from RFC 4122 §4.3.
 
static Guid Create (Guid namespaceId, byte[] nameBytes, int version)
 Creates a name-based UUID using the algorithm from RFC 4122 §4.3.
 

Static Public Attributes

static readonly Guid DnsNamespace = new Guid("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
 The namespace for fully-qualified domain names (from RFC 4122, Appendix C).
 
static readonly Guid UrlNamespace = new Guid("6ba7b811-9dad-11d1-80b4-00c04fd430c8")
 The namespace for URLs (from RFC 4122, Appendix C).
 
static readonly Guid IsoOidNamespace = new Guid("6ba7b812-9dad-11d1-80b4-00c04fd430c8")
 The namespace for ISO OIDs (from RFC 4122, Appendix C).
 

Detailed Description

Helper methods for working with Guid.

Member Function Documentation

◆ Create() [1/4]

static Guid DepictionEngine.GuidUtility.Create ( Guid  namespaceId,
byte[]  nameBytes 
)
static

Creates a name-based UUID using the algorithm from RFC 4122 §4.3.

Parameters
namespaceIdThe ID of the namespace.
nameBytesThe name (within that namespace).
Returns
A UUID derived from the namespace and name.

◆ Create() [2/4]

static Guid DepictionEngine.GuidUtility.Create ( Guid  namespaceId,
byte[]  nameBytes,
int  version 
)
static

Creates a name-based UUID using the algorithm from RFC 4122 §4.3.

Parameters
namespaceIdThe ID of the namespace.
nameBytesThe name (within that namespace).
versionThe version number of the UUID to create; this value must be either 3 (for MD5 hashing) or 5 (for SHA-1 hashing).
Returns
A UUID derived from the namespace and name.

◆ Create() [3/4]

static Guid DepictionEngine.GuidUtility.Create ( Guid  namespaceId,
string  name 
)
static

Creates a name-based UUID using the algorithm from RFC 4122 §4.3.

Parameters
namespaceIdThe ID of the namespace.
nameThe name (within that namespace).
Returns
A UUID derived from the namespace and name.

◆ Create() [4/4]

static Guid DepictionEngine.GuidUtility.Create ( Guid  namespaceId,
string  name,
int  version 
)
static

Creates a name-based UUID using the algorithm from RFC 4122 §4.3.

Parameters
namespaceIdThe ID of the namespace.
nameThe name (within that namespace).
versionThe version number of the UUID to create; this value must be either 3 (for MD5 hashing) or 5 (for SHA-1 hashing).
Returns
A UUID derived from the namespace and name.

◆ ToLowerNoDashString()

static string DepictionEngine.GuidUtility.ToLowerNoDashString ( this Guid  guid)
static

Converts a GUID to a lowercase string with no dashes.

Parameters
guidThe GUID.
Returns
The GUID as a lowercase string with no dashes.

◆ TryFromLowerNoDashString()

static ? Guid DepictionEngine.GuidUtility.TryFromLowerNoDashString ( string  value)
static

Attempts to convert a lowercase, no dashes string to a GUID.

Parameters
valueThe string.
Returns
The GUID, if the string could be converted; otherwise, null.

◆ TryParse()

static bool DepictionEngine.GuidUtility.TryParse ( string  value,
out Guid  guid 
)
static

Tries to parse the specified string as a Guid. A return value indicates whether the operation succeeded.

Parameters
valueThe GUID string to attempt to parse.
guidWhen this method returns, contains the Guid equivalent to the GUID contained in value , if the conversion succeeded, or Guid.Empty if the conversion failed.
Returns
true if a GUID was successfully parsed; false otherwise.

The documentation for this class was generated from the following file: