Ejemplo n.º 1
0
 private string GenerateObfuscatedValue(string value)
 {
     lock (ObfuscatedValues)
     {
         if (!ObfuscatedValues.Contains(value))
         {
             return(value);
         }
     }
     return(GenerateObfuscatedValue(GeneratePermutationValue()));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates and returns a random generated <see cref="string"/> with a factorial size of (x - <see cref="CurrentCombinationLength"/>) ideal for obfuscated usage.
        /// </summary>
        /// <returns>A random generated <see cref="string"/> with a factorial size of (x - <see cref="CurrentCombinationLength"/>) ideal for obfuscated usage, where x in the default implementation equals 62.</returns>
        /// <remarks>
        /// This implementation uses the values from <see cref="PermutationCharacters"/> to compute the permutation.
        /// Using the standard implementation gives a close to limitless permutation in regards to obfuscation, as the value automatically grows when needed.
        /// </remarks>
        protected string GenerateObfuscatedValue()
        {
            HandlePermutationCalculation();
            string obfuscatedValue = GenerateObfuscatedValue(GeneratePermutationValue());

            lock (ObfuscatedValues)
            {
                ObfuscatedValues.Add(obfuscatedValue);
            }
            return(obfuscatedValue);
        }