blob: d0e488cc49093acbfe870939cd59828ab9269d1d [file] [log] [blame]
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
#include "Math.hpp"
#include "CPUID.hpp"
namespace sw
{
inline uint64_t FNV_1a(uint64_t hash, unsigned char data)
{
return (hash ^ data) * 1099511628211;
}
uint64_t FNV_1a(const unsigned char *data, int size)
{
int64_t hash = 0xCBF29CE484222325;
for(int i = 0; i < size; i++)
{
hash = FNV_1a(hash, data[i]);
}
return hash;
}
}