Example #1
0
        /// <summary>
        /// Run the hash algorithm on the file and apply all required actions to said file.
        /// </summary>
        /// <param name="fileInfo">File to action</param>
        /// <param name="algorithm">Algorithm to use</param>
        /// <param name="finalOutputDirPath">The final output directory for the file</param>
        private void RunOnFile(FileInfo fileInfo, HashAlgorithm algorithm, string finalOutputDirPath)
        {
            string hash = HashUtils.GetHashFromFile(fileInfo, algorithm);

            string destination = Path.Combine(finalOutputDirPath,
                                              (_options.Lowercase ? hash.ToLower() : hash) + fileInfo.Extension);

            ActionFile(fileInfo, destination);
        }
Example #2
0
        private void RunOnFile(FileInfo fileInfo, HashAlgorithm algorithm)
        {
            string hash = HashUtils.GetHashFromFile(fileInfo, algorithm);

            _streamWriter.WriteLine(fileInfo.FullName + _options.Separator + (_options.Lowercase ? hash.ToLower() : hash));
        }