Exemple #1
0
        private byte[] Hi(HMAC hmac, string password, byte[] salt, int iterationCount)
        {
            if (iterationCount <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(iterationCount), "Iteration count must be a positive integer");
            }

            byte[]  key  = Encoding.UTF8.GetBytes(password);
            byte [] data = new byte[salt.Length + 4];
            data[data.Length - 1] = 1;
            hmac.Key = key;

            byte[]  hash   = hmac.ComputeHash(data);
            byte [] result = ArrayUtil.Clone(hash);
            for (int i = 1; i < iterationCount; i++)
            {
                hash = hmac.ComputeHash(hash);
                for (int j = 0; j < result.Length; j++)
                {
                    result[j] ^= hash[j];
                }
            }

            return(result);
        }
        public object Clone()
        {
            FontChangeData that = new FontChangeData();

            that.font       = this.font;
            that.uiFont     = this.uiFont;
            that.references = ArrayUtil.Clone <UIFont>(this.references);
            return(that);
        }
Exemple #3
0
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public object Clone()
        {
            var clone = new StyleSheet();

            if (null != Declarations)
            {
                clone.Declarations = ArrayUtil <StyleDeclaration> .Clone(Declarations);
            }

            return(clone);
        }
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public object Clone()
        {
            StyleDeclaration clone = new StyleDeclaration
            {
                Module = Module,
                Type   = Type,
                Class  = Class,
                Id     = Id
            };

            if (null != Properties)
            {
                clone.Properties = ArrayUtil <StyleProperty> .Clone(Properties);
            }

            if (null != MediaQueries)
            {
                clone.MediaQueries = ArrayUtil <MediaQuery> .Clone(MediaQueries);
            }

            return(clone);
        }