mirror of
https://github.com/sphildreth/roadie
synced 2024-11-10 06:44:12 +00:00
34 lines
No EOL
801 B
C#
34 lines
No EOL
801 B
C#
using Microsoft.AspNetCore.WebUtilities;
|
|
using Roadie.Library.Encoding;
|
|
using System.Web;
|
|
|
|
namespace Roadie.Api.Services
|
|
{
|
|
public class HttpEncoder : IHttpEncoder
|
|
{
|
|
public string HtmlEncode(string s)
|
|
{
|
|
return HttpUtility.HtmlEncode(s);
|
|
}
|
|
|
|
public string UrlDecode(string s)
|
|
{
|
|
return HttpUtility.UrlDecode(s);
|
|
}
|
|
|
|
public string UrlEncode(string s)
|
|
{
|
|
return HttpUtility.UrlEncode(s);
|
|
}
|
|
|
|
public string UrlEncodeBase64(byte[] input)
|
|
{
|
|
return WebEncoders.Base64UrlEncode(input);
|
|
}
|
|
|
|
public string UrlEncodeBase64(string input)
|
|
{
|
|
return WebEncoders.Base64UrlEncode(System.Text.Encoding.ASCII.GetBytes(input));
|
|
}
|
|
}
|
|
} |