Exemplo n.º 1
0
        /// <summary>
        /// A method for getting a TTH hash from a specified file path
        /// </summary>
        /// <param name="filePath">The path for the file to hash</param>
        /// <returns>A string containing the TTH hash</returns>
        public static string GetTTH(string filePath)
        {
            TTH_Optimized TTH  = new TTH_Optimized();
            string        hash = HashStringConverter.ToBase32String(TTH.GetTTH(filePath)).ToLower();

            return(hash);
        }
Exemplo n.º 2
0
        /// <summary>
        /// A method for getting a TTH hash from a specified file path
        /// </summary>
        /// <param name="file">The FileStream to hash</param>
        /// <returns>A string containing the TTH hash</returns>
        public static string GetTTH(FileStream file)
        {
            TTH_Optimized TTH  = new TTH_Optimized();
            string        hash = HashStringConverter.ToBase32String(TTH.GetTTH(file.Name)).ToLower();

            return(hash);
        }