$licenseKey = makeRandomKey(); //make random key
$dbKey = base64_encode(md5($licenseKey, true));
//Save that key to database
//C# code to MD5 same way as PHP
private string MD5_this(String input)
{
System.Security.Cryptography.MD5 alg = System.Security.Cryptography.MD5.Create();
UTF8Encoding enc = new UTF8Encoding();
byte[] hash = alg.ComputeHash(enc.GetBytes(input));
string output = Convert.ToBase64String(hash);
return output;
}