mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 22:40:30 +00:00
25 lines
590 B
C#
25 lines
590 B
C#
using System;
|
|
using System.Net;
|
|
|
|
namespace SteamAuth
|
|
{
|
|
public class Util
|
|
{
|
|
public static long GetSystemUnixTime()
|
|
{
|
|
return (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
|
}
|
|
|
|
public static byte[] HexStringToByteArray(string hex)
|
|
{
|
|
int hexLen = hex.Length;
|
|
byte[] ret = new byte[hexLen / 2];
|
|
for (int i = 0; i < hexLen; i += 2)
|
|
{
|
|
ret[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
|
|
}
|
|
return ret;
|
|
}
|
|
}
|
|
}
|