Click here to Skip to main content
11,920,772 members (56,108 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Windows .NET
Heya smart friends,

I noticed that .NET hash function can produce different values on different machines.
I need a hash function (for strings) that will produce the same value, no matter what platform it is on, whether it's win xp, vista, 7, 8, server 2k3, 2k8 etc
AND no matter if it's 32 bit or 64 bit (which to my understanding makes a big difference in the hash implementation).

Posted 7-Jan-13 20:34pm
Joezer BH38.4K
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Edo Tzumer 8-Jan-13 2:05am
Hi Tadit, the link leads a similar question, HOWEVER, it is unanswered there (or to be exact, there is an incorrect answer there).
Tadit Dash 8-Jan-13 2:14am
Oh I just saw that you have asked that question as well... :P
Have you tried the solution in that link provided by @Kenneth Haugland?
Edo Tzumer 8-Jan-13 2:25am
Kenneth suggested the .NET solution, which, even though a great hashing, but as I mentioned there, does not produce the same values on different platform.

So, if you need to produce the hash on two different machines, that won't work...

Do you have an idea?
Edo Tzumer 8-Jan-13 2:36am
Actually Kenneth suggested to use RSA which is not even hashing, it's an enctypt\decrypt .NET implemented algorithm.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Late but still...

What I've used eventually is the built in hashing mechanism of MS SQL Server,
I've had it storing the data anyway, so I figures out, hey, it is central, cross platform, actually its cross whatever you want since I only use one SQL Server in that project.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 415
1 phil.o 170
2 Dave Kreskowiak 155
3 KrunalRohit 134
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,203
3 George Jonsson 2,815
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web01 | 2.8.151120.1 | Last Updated 22 Jul 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100