CodeLiturgy.Dashboard/BlueWest.Data/Core/CodeGenerator.cs

25 lines
729 B
C#

using System;
using System.Security.Cryptography;
namespace BlueWest.Data
{
public class CodeGenerator
{
/*public string GetInviteCode(bool isBase64 = false)
{
var unix = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
var unixStr = unix.ToString("0000000000")[^6..];
byte[] bytes = RandomNumberGenerator.GetBytes(6);
var hexArray = Array.ConvertAll(bytes, x => x.ToString("X2"));
var hexStr = string.Concat(hexArray);
var resultCode = isBase64
? Convert.ToBase64String(Convert.FromHexString(unixStr + hexStr))
: unixStr + hexStr;
return resultCode;
}*/
}
}