Class GuidUtility
Provides methods for easy workign with guids
Inheritance
Inherited Members
Namespace: Simplic
Assembly: Simplic.CoreLib.dll
Syntax
public static class GuidUtility
Fields
| Improve this Doc View SourceDnsNamespace
The namespace for fully-qualified domain names (from RFC 4122, Appendix C).
Declaration
public static readonly Guid DnsNamespace
Field Value
Type | Description |
---|---|
System.Guid |
IsoOidNamespace
The namespace for ISO OIDs (from RFC 4122, Appendix C).
Declaration
public static readonly Guid IsoOidNamespace
Field Value
Type | Description |
---|---|
System.Guid |
UrlNamespace
The namespace for URLs (from RFC 4122, Appendix C).
Declaration
public static readonly Guid UrlNamespace
Field Value
Type | Description |
---|---|
System.Guid |
Methods
| Improve this Doc View SourceCreate(Guid, String)
Creates a name-based UUID using the algorithm from RFC 4122 §4.3.
Declaration
public static Guid Create(Guid namespaceId, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | namespaceId | The ID of the namespace. |
System.String | name | The name (within that namespace). |
Returns
Type | Description |
---|---|
System.Guid | A UUID derived from the namespace and name. |
Remarks
| Improve this Doc View SourceCreate(Guid, String, Int32)
Creates a name-based UUID using the algorithm from RFC 4122 §4.3.
Declaration
public static Guid Create(Guid namespaceId, string name, int version)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | namespaceId | The ID of the namespace. |
System.String | name | The name (within that namespace). |
System.Int32 | version | The version number of the UUID to create; this value must be either 3 (for MD5 hashing) or 5 (for SHA-1 hashing). |
Returns
Type | Description |
---|---|
System.Guid | A UUID derived from the namespace and name. |
Remarks
| Improve this Doc View SourceCreate(String)
Creates a name-base UUID using IsoOidNamespace and intern md5 hash
Declaration
public static Guid Create(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
System.Guid |
GetNewIfNullOrEmpty(Nullable<Guid>)
Create a new guid if it is currently null or empty
Declaration
public static Guid GetNewIfNullOrEmpty(Guid? guid)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Guid> | guid | Input guid |
Returns
Type | Description |
---|---|
System.Guid | Return the existing guid if it not null or a 0-Guid, else it's creating a new one |