Ejemplo n.º 1
0
        /// <summary>
        /// Generate a random salt.
        /// </summary>
        /// <param name="minimum">The minimum length of the salt.</param>
        /// <param name="maximum">The minimum length of the salt.</param>
        /// <returns>The random salt value.</returns>
        public static byte[] GenerateSalt(int minimum = 32, int maximum = 32)
        {
            // Generate a random salt.
            Nequeo.Cryptography.RandomPassword salt = new Nequeo.Cryptography.RandomPassword();
            string saltString = salt.Generate(minimum, maximum);

            return(Encoding.Default.GetBytes(saltString));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Generate a random salt.
 /// </summary>
 /// <param name="minimum">The minimum length of the salt.</param>
 /// <param name="maximum">The minimum length of the salt.</param>
 /// <returns>The random salt value.</returns>
 public static string GenerateSalt(int minimum = 20, int maximum = 20)
 {
     // Generate a random salt.
     Nequeo.Cryptography.RandomPassword salt = new Nequeo.Cryptography.RandomPassword();
     return(salt.Generate(minimum, maximum));
 }