From 5a4932775b08be580b927a17c39e22d85d31b842 Mon Sep 17 00:00:00 2001 From: Feli R <54976920+YaF3li@users.noreply.github.com> Date: Mon, 7 Oct 2019 12:06:42 +0200 Subject: [PATCH] Changed encoding in C# version to UTF8 (#33) --- csharp/pwned-search.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csharp/pwned-search.cs b/csharp/pwned-search.cs index 664e387..6936821 100644 --- a/csharp/pwned-search.cs +++ b/csharp/pwned-search.cs @@ -7,13 +7,13 @@ using System.IO; namespace pwned_search { class Program { static void Main(string[] args) { - Console.InputEncoding = Console.OutputEncoding = System.Text.Encoding.Unicode; + Console.InputEncoding = Console.OutputEncoding = Encoding.UTF8; Console.Write("Enter the password to check: "); string plaintext = Console.ReadLine(); SHA1 sha = new SHA1CryptoServiceProvider(); - byte[] data = sha.ComputeHash(Encoding.Unicode.GetBytes(plaintext)); + byte[] data = sha.ComputeHash(Encoding.UTF8.GetBytes(plaintext)); // Loop through each byte of the hashed data // and format each one as a hexadecimal string.