Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
StringHashHelper.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Text;
6 
7 namespace SiliconStudio.Core.Serialization
8 {
9  internal static class StringHashHelper
10  {
11  public static uint GetSerializerHashCode(this string param)
12  {
13  uint result = 0;
14  foreach (char c in param)
15  {
16  result ^= result << 4;
17  result ^= result << 24;
18  result ^= c;
19  }
20  return result;
21  }
22  }
23 }