using System;
using Havit.Extensions.DependencyInjection.Abstractions;
using Microsoft.AspNetCore.WebUtilities;

namespace DiplomovaPrace.Services.Encoders
{
	[Service]
	public class EncoderService : IEncoderService
	{
		public byte[] Decode(string input)
		{
			try
			{
				return WebEncoders.Base64UrlDecode(input);
			}
			catch (Exception)
			{
				return null;
			}
		}
	}
}
