Exemplo n.º 1
0
        /// <summary>
        /// Hashes one or more string values into the final computation of this FNV1aHash instance.
        /// </summary>
        /// <param name="hash">target FNV1aHash</param>
        /// <param name="values">array of string values to compute</param>
        /// <returns>Current hash value after provided steps are computed</returns>
        public static int Step(this FNV1aHash hash, params string[] values)
        {
            var output = 0;

            foreach (var value in values)
            {
                output = hash.Step(Encoding.UTF8.GetBytes(value));
            }
            return(output);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Hashes one or more long values into the final computation of this FNV1aHash instance.
 /// </summary>
 /// <param name="hash">target FNV1aHash</param>
 /// <param name="values">array of long values to compute</param>
 /// <returns>Current hash value after provided steps are computed</returns>
 public static int Step(this FNV1aHash hash, params long[] values)
 {
     return(hash.Step(values.SelectMany(BitConverter.GetBytes).ToArray()));
 }