22 lines
		
	
	
		
			401 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			401 B
		
	
	
	
		
			C#
		
	
	
	
	
	
namespace Engine.Systems.Network;
 | 
						|
 | 
						|
public static class Hasher
 | 
						|
{
 | 
						|
    public static long FNV1a(string name)
 | 
						|
    {
 | 
						|
        const long fnvPrime = 1099511628211;
 | 
						|
        long result = 1469598103934665603;
 | 
						|
 | 
						|
        unchecked
 | 
						|
        {
 | 
						|
            foreach (char c in name)
 | 
						|
            {
 | 
						|
                result ^= c;
 | 
						|
                result *= fnvPrime;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        return result;
 | 
						|
    }
 | 
						|
}
 |