Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows .NET software
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).
 
Anyone?
Posted 7-Jan-13 20:34pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Comments
Edo Tzumer at 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 at 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 at 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 at 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
good
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.
 
Cheers
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 334
1 Kornfeld Eliyahu Peter 325
2 Maciej Los 239
3 OriginalGriff 188
4 King Fisher 185
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 22 Jul 2013
Copyright © CodeProject, 1999-2014
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