mirror of
https://github.com/sphildreth/roadie
synced 2024-11-25 05:30:24 +00:00
35 lines
No EOL
808 B
C#
35 lines
No EOL
808 B
C#
using Microsoft.AspNetCore.WebUtilities;
|
|
using Roadie.Library.Encoding;
|
|
using System.Text;
|
|
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(Encoding.ASCII.GetBytes(input));
|
|
}
|
|
}
|
|
} |