18 lines
658 B
C#
18 lines
658 B
C#
using System.Text;
|
|
|
|
namespace DataTransfer.Components.Layout;
|
|
|
|
/// <summary>
|
|
/// Encoding for personal data (e-mail addresses, name, postal address) that the server writes into the HTML, so
|
|
/// harvesters that scan the HTML find nothing usable. wwwroot/DataTransfer.lib.module.js decodes it in the browser.
|
|
/// </summary>
|
|
public static class ProtectedData
|
|
{
|
|
// Reversed UTF-8 bytes in base64: no '@', no readable words and nothing that looks like an address.
|
|
public static string Encode(string value)
|
|
{
|
|
var bytes = Encoding.UTF8.GetBytes(value);
|
|
Array.Reverse(bytes);
|
|
return Convert.ToBase64String(bytes);
|
|
}
|
|
}
|