Esempio n. 1
0
        protected override int ExecuteCommand(CommandLineApplication app, IConsole console)
        {
            Log.Info("Listing files...");

            var filesList = GetFilesList(app).ToList();

            Log.Info($"Processing {filesList.Count} files.");

            var i          = 0;
            var outputList = new List <string>();

            foreach (var file in filesList)
            {
                outputList.Add($"{file} >> {UoeHash.Hash(File.ReadAllBytes(file))}");
                i++;
                Log.ReportProgress(filesList.Count, i, $"Computing hash for : {file}.");
            }

            foreach (var file in outputList)
            {
                Out.WriteResultOnNewLine(file);
            }

            return(0);
        }
Esempio n. 2
0
        protected override int ExecuteCommand(CommandLineApplication app, IConsole console)
        {
            if (!string.IsNullOrEmpty(Value))
            {
                Out.WriteResultOnNewLine(UoeHash.Hash(Encoding.Default.GetBytes(Value)));
            }

            return(0);
        }
 public void Test(byte[] input, string output)
 {
     Assert.AreEqual(output, UoeHash.Hash(input));
 }