This commit is contained in:
2018-06-28 23:37:38 +00:00
commit 4518298aaf
152 changed files with 24114 additions and 0 deletions

35
util/fetchkeycode.cs Normal file
View File

@@ -0,0 +1,35 @@
using System;
namespace rockfishCore.Util
{
//Generate a random code for license key fetching
//doesn't have to be perfect, it's only temporary and
//requires knowledge of the customer / trial user
//email address to use it so it's kind of 2 factor
public static class FetchKeyCode
{
public static string generate()
{
//sufficient for this purpose
//https://stackoverflow.com/a/1344258/8939
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var stringChars = new char[10];
var random = new Random();
for (int i = 0; i < stringChars.Length; i++)
{
stringChars[i] = chars[random.Next(chars.Length)];
}
var finalString = new String(stringChars);
return finalString;
}
}//eoc
}//eons