using System.Security.Cryptography;

namespace AiLogia.Auth.Services;

public static class Crypto
{
    public static string GenerateTokenBase64Url(int bytes = 32)
    {
        var raw = RandomNumberGenerator.GetBytes(bytes);
        var s = Convert.ToBase64String(raw)
            .Replace('+', '-').Replace('/', '_').TrimEnd('=');
        return s;
    }
}