public string generateSessionID() { String finalID = null; Random rnd = new Random(); int firstID = rnd.Next(99999); int secondID = rnd.Next(99); int thirdID = rnd.Next(9999999); Random rand = new Random(Guid.NewGuid().GetHashCode() + firstID + secondID + thirdID); int combID = rand.Next(999999); int combID2 = rand.Next(999999999); byte[] intBytes = BitConverter.GetBytes(combID); Array.Reverse(intBytes); byte[] result = intBytes; encryption newEnc = new encryption(); finalID = encryption.ComputeHash(combID2.ToString(), "SHA512", result); return finalID; }
public string generateSessionID() { string finalID = null; var rnd = new Random(); var firstID = rnd.Next(99999); var secondID = rnd.Next(99); var thirdID = rnd.Next(9999999); var rand = new Random(Guid.NewGuid().GetHashCode() + firstID + secondID + thirdID); var combID = rand.Next(999999); var combID2 = rand.Next(999999999); byte[] intBytes = BitConverter.GetBytes(combID); Array.Reverse(intBytes); byte[] result = intBytes; var newEnc = new encryption(); finalID = encryption.ComputeHash(combID2.ToString(), "SHA512", result); return(finalID); }