TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
HashTrait< G3D::Vector3int32 > Struct Template Reference

#include <Vector3int32.h>

Static Public Member Functions

static size_t hashCode (const G3D::Vector3int32 &key)
 

Member Function Documentation

static size_t HashTrait< G3D::Vector3int32 >::hashCode ( const G3D::Vector3int32 key)
inlinestatic
183  {
184  return G3D::superFastHash(&key, sizeof(key));
185  //return G3D::Crypto::crc32(&key, sizeof(key));
186  /*
187  // Mask for the top bit of a uint32
188  const G3D::uint32 top = (1UL << 31);
189  // Mask for the bottom 10 bits of a uint32
190  const G3D::uint32 bot = 0x000003FF;
191  return static_cast<size_t>(((key.x & top) | ((key.y & top) >> 1) | ((key.z & top) >> 2)) |
192  (((key.x & bot) << 19) ^ ((key.y & bot) << 10) ^ (key.z & bot)));
193  */
194  }
uint32_t superFastHash(const void *_data, size_t numBytes)
A hash function that is faster than CRC32 for arbitrary long strings http://www.azillionmonkeys.com/qed/hash.html by Paul Hsieh.
Definition: HashTrait.h:35

+ Here is the call graph for this function:


The documentation for this struct was generated from the following file: