Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:17:20+00:00 2026-05-28T05:17:20+00:00

Here are two hash generators: http://www.md5hashgenerator.com/index.php http://www.miraclesalad.com/webtools/md5.php Now, my question is: Why do the

  • 0

Here are two hash generators:

  1. http://www.md5hashgenerator.com/index.php
  2. http://www.miraclesalad.com/webtools/md5.php

Now, my question is:
Why do the hashes differ when trying to hash the char ‘€’ (0x80)?
I assume it happens because ‘€’ is not a normal ASCII character.
Which of the two hashes is ‘correct’?

I’m trying to calculate the hash returned by hash generator 1 with C#.
This hashing function doesn’t return it.

private string GetMD5Hash(string TextToHash)
{
        if ((TextToHash == null) || (TextToHash.Length == 0))
        {
            return string.Empty;
        }
        MD5 md5 = new MD5CryptoServiceProvider();
        byte[] textToHash = Encoding.Default.GetBytes(TextToHash);
        byte[] result = md5.ComputeHash(textToHash);
        return BitConverter.ToString(result).Replace("-", "").ToLower();
}

How could I change it so it returns the hash I want?


Additional Info:
I made a little AutoIt script:

#include  <Crypt.au3>
ConsoleWrite(StringLower(StringMid(_Crypt_HashData(Chr(128), $CALG_MD5),3)) & @CRLF)

and it returns the hash I want!
However I need a C# code 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:17:20+00:00Added an answer on May 28, 2026 at 5:17 am

    It comes down to which encoding you use to turn the string into a byte[] (hence my suggestion to use try UTF-8, as that is a pretty common choice here; however, any full unicode encoding would work as long as you know which to use) ; for example, based on the string "abc€" we can deduce that the first site might be using any of:

    874: Thai (Windows)
    936: Chinese Simplified (GB2312)
    1250: Central European (Windows)
    1252: Western European (Windows)
    1253: Greek (Windows)
    1254: Turkish (Windows)
    1255: Hebrew (Windows)
    1256: Arabic (Windows)
    1257: Baltic (Windows)
    1258: Vietnamese (Windows)
    50227: Chinese Simplified (ISO-2022)
    51936: Chinese Simplified (EUC)
    52936: Chinese Simplified (HZ)
    

    Personally, I’d use UTF-8!

    Here’s the code I used to find the candidate encodings:

        MD5 md5 = new MD5CryptoServiceProvider();
        foreach (var enc in Encoding.GetEncodings())
        {
            byte[] textToHash = enc.GetEncoding().GetBytes("abc€");
            byte[] result = md5.ComputeHash(textToHash);
            var output = BitConverter.ToString(result).Replace("-", "").ToLower();
            if(output == "7a66042043b2cc38ba16a13c596d740e")
            {  // result from http://www.md5hashgenerator.com/index.php
                Console.WriteLine(enc.CodePage + ": " + enc.DisplayName);
            }
        }
    

    Further, testing with the string "dnos ʇǝqɐɥdʃɐ" shows that the second site is definitely using UTF-8; the first site finds no matches, so I guess it is using a code-page based encoding, and in short will not work reliably with the full range of unicode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question, here are two classes below: class Base{ public: virtual void
Here's an example of two different dictionaries, yet they return the same hash code.
Here are two different questions but I think they are related. When using Git,
Here are two chunks of code that accomplish (what I think is) the same
Here are two questions related to modifying the data source for strongly typed dataset
Here's two screen shots, showing the effect with a small viewport that has to
Here is two variants. First: int n = 42; int* some_function(int* input) { int*
If you want to associate some constant value with a class, here are two
I have a very strange behavior with Request.Form . Here are two IIS 7
I have a menu bar that is rotated slightly. Here are two buttons as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.