This commit is contained in:
2020-04-28 19:37:58 +00:00
parent 5cc547c1b3
commit 5c1e0c52d1
2 changed files with 14 additions and 16 deletions

View File

@@ -7,6 +7,7 @@ using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using System.Security.Cryptography;
namespace AyaNova.PlugIn.V8
@@ -189,6 +190,17 @@ namespace AyaNova.PlugIn.V8
#region Misc utils
//used to set nonsense values from imported user login and password
//just in case they are set active after import but never have their passwords set
//so they can't be as easily hacked into
public static string RandomString()
{
var b = new byte[32];
var random = RandomNumberGenerator.Create();
random.GetNonZeroBytes(b);
return Convert.ToBase64String(b);
}
public static string NormalizeTag(string inObj)
{
//Must be lowercase per rules