Changed encoding in C# version to UTF8 (#33)

This commit is contained in:
Feli R 2019-10-07 12:06:42 +02:00 committed by Michael Pound
parent 33899e9a50
commit 5a4932775b

View File

@ -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.