fork(4) download
  1. using System;
  2. using System.IO;
  3. using System.Linq;
  4. using System.Security.Cryptography;
  5. public class Test
  6. {
  7. public static void Main(string[] args)
  8. {
  9. if (args.Length < 1) {
  10. Console.WriteLine("usage: hashlist.exe 入力ファイル [出力ファイル]");
  11. return;
  12. }
  13. var inFile = args[0];
  14. var outFile = args.Length >= 2 ? args[1] : "result.txt";
  15.  
  16. if (!File.Exists(inFile)) {
  17. Console.WriteLine("Error: 入力ファイルが見つかりません");
  18. return;
  19. }
  20. var sha256 = SHA256.Create();
  21. File.WriteAllLines(outFile,
  22. File.ReadAllLines(args[0])
  23. .Select(_ => BitConverter.ToString(sha256.ComputeHash(Convert.FromBase64String(_))).Replace("-", "").ToLower())
  24. );
  25. }
  26. }
Success #stdin #stdout 0.01s 131520KB
stdin
Standard input is empty
stdout
usage: hashlist.exe 入力ファイル [出力ファイル]