// Decompiled with JetBrains decompiler
// Type: FiestaLauncher.Services.ResourceService
// Assembly: FiestaOnline, Version=2019.5.22.0, Culture=neutral, PublicKeyToken=null
// MVID: 2FD5EB61-BC25-469D-997E-88998E849F6A
// Assembly location: C:\Users\marbo\Documents\Gamigo 2020 Client\FiestaOnline.exe

using System;
using System.Text;

namespace FiestaLauncher.Services
{
  public static class ResourceService
  {
    private static readonly DateTime StaticDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
    private static readonly Random Random = new Random((int) DateTime.Now.Ticks);

    public static long GetCurrentMilliseconds()
    {
      return (long) (DateTime.UtcNow.ToLocalTime() - ResourceService.StaticDate).TotalMilliseconds;
    }

    internal static string RandomString(int size)
    {
      StringBuilder stringBuilder = new StringBuilder();
      for (int index = 0; index < size; ++index)
      {
        char ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26.0 * ResourceService.Random.NextDouble() + 65.0)));
        stringBuilder.Append(ch);
      }
      return stringBuilder.ToString();
    }
  }
}
