C# Class CqlSharp.TimeGuid

Helper class to generate Time based GUIDs. Thanks to Casssandra-Sharp project.
Mostrar archivo Open project: reuzel/CqlSharp

Public Properties

Property Type Description
Default System.Guid
GregorianCalendarStart DateTime

Public Methods

Method Description
GenerateTimeBasedGuid ( ) : System.Guid

Generates a time based unique identifier, set to the current time.

GenerateTimeBasedGuid ( long time, int sequence, byte nodeId ) : System.Guid

Generates a time based unique identifier.

GenerateTimeBasedGuid ( this dateTime, byte node = null ) : Guid

Generates a time based unique identifier.

GetDateTime ( this guid ) : DateTime

Gets the date time from the provided Guid.

Private Methods

Method Description
CreateNodeId ( ) : byte[]

Creates a node unique identifier.

TimeGuid ( ) : System

Initializes the TimeGuid class.

Method Details

GenerateTimeBasedGuid() public static method

Generates a time based unique identifier, set to the current time.
public static GenerateTimeBasedGuid ( ) : System.Guid
return System.Guid

GenerateTimeBasedGuid() public static method

Generates a time based unique identifier.
public static GenerateTimeBasedGuid ( long time, int sequence, byte nodeId ) : System.Guid
time long The time, being the number of 100ns intervals since Gregorian Calendar start
sequence int The sequence, or clockId.
nodeId byte The node unique identifier.
return System.Guid

GenerateTimeBasedGuid() public static method

Generates a time based unique identifier.
public static GenerateTimeBasedGuid ( this dateTime, byte node = null ) : Guid
dateTime this The date time.
node byte /// The node. Must either be null or a 6 byte array. When set to null (recommended), a random node id /// will be provided ///
return Guid

GetDateTime() public static method

Gets the date time from the provided Guid.
public static GetDateTime ( this guid ) : DateTime
guid this The unique identifier.
return DateTime

Property Details

Default public_oe static_oe property

The default Time Guid (nodeId, time and sequence all set to 0, but having the version number set to timeguid)
public static Guid,System Default
return System.Guid

GregorianCalendarStart public_oe static_oe property

public static DateTime GregorianCalendarStart
return DateTime