Beispiel #1
0
 public static string GetTimeId(DateTime datetime, bool ascending = false)
 {
     var writer = new Base64Writer(8);
     var tick = datetime.Ticks;
     if (!ascending)
         tick = -tick;
     writer.Write(tick);
     return writer.ToString();
 }
Beispiel #2
0
 public static string NewSortableId(DateTime dateTime, bool ascending = false)
 {
     var writer = new Base64Writer(12);
     var tick = dateTime.Ticks;
     if (!ascending)
         tick = -tick;
     writer.Write(tick);
     writer.Write(Random.Next());
     return writer.ToString();
 }
Beispiel #3
0
        public static string GetTimeId(DateTime datetime, bool ascending = false)
        {
            var writer = new Base64Writer(8);
            var tick   = datetime.Ticks;

            if (!ascending)
            {
                tick = -tick;
            }
            writer.Write(tick);
            return(writer.ToString());
        }
Beispiel #4
0
        public static string NewSortableId(DateTime dateTime, bool ascending = false)
        {
            var writer = new Base64Writer(12);
            var tick   = dateTime.Ticks;

            if (!ascending)
            {
                tick = -tick;
            }
            writer.Write(tick);
            writer.Write(Random.Next());
            return(writer.ToString());
        }