Exemple #1
0
        public bool TryDeobfuscateField(string obfuscatedFieldName, out string originalFieldName)
        {
            int lo = 0;
            int hi = m_fields.Length - 1;

            while (lo <= hi)
            {
                int             i     = lo + ((hi - lo) >> 1);
                ObfuscatedField field = m_fields[i];

                int order = m_comparer.Compare(field.ObfuscatedName, obfuscatedFieldName);

                if (order == 0)
                {
                    originalFieldName = field.OriginalName;
                    return(true);
                }

                if (order < 0)
                {
                    lo = i + 1;
                }
                else
                {
                    hi = i - 1;
                }
            }

            originalFieldName = null;
            return(false);
        }
        public bool TryObfuscateField(string originalFieldName, out ObfuscatedField obfuscatedFieldName)
        {
            for (int i = 0; i < m_fields.Length; i++)
            {
                ObfuscatedField field = m_fields[i];

                if (m_comparer.Compare(field.OriginalName, originalFieldName) == 0)
                {
                    obfuscatedFieldName = field;
                    return(true);
                }
            }

            obfuscatedFieldName = default(ObfuscatedField);
            return(false);
        }
 public bool TryObfuscateField(string originalFieldName, out ObfuscatedField obfuscatedFieldName)
 {
     obfuscatedFieldName = default(ObfuscatedField);
     return(false);
 }