Evo C++ Library v0.5.1
Public Types | Static Public Member Functions | List of all members
DataHash< T, H, B > Struct Template Reference

#include <evo/impl/container.h>

Inheritance diagram for DataHash< T, H, B >:
Inheritance graph
[legend]

Detailed Description

template<class T, class H = SpookyHash, bool B = IsPodType<T>::value>
struct evo::DataHash< T, H, B >

Optimized data hash helpers.

Template Parameters
TData type to use
HHashing class to use for POD data, ignored with non-POD types
BInferred from T

Public Types

typedef H HashType
 Hash class type More...
 
typedef RemoveConst< T >::Type Item
 Item type (const removed) More...
 

Static Public Member Functions

static ulong hash (const T *data, ulong size, ulong seed=0)
 Compute hash value from data. More...
 
static ulong hash (const T &data, ulong seed=0)
 Compute hash value from data. More...
 

Member Typedef Documentation

◆ HashType

typedef H HashType

Hash class type

◆ Item

typedef RemoveConst<T>::Type Item
inherited

Item type (const removed)

Member Function Documentation

◆ hash() [1/2]

static ulong hash ( const T *  data,
ulong  size,
ulong  seed = 0 
)
inlinestatic

Compute hash value from data.

  • This uses T::hash() method to chain-hash each item, for POD types this uses H::hash() on the whole array
Parameters
dataData to use
sizeData size as item count
seedSeed value for chaining from a previous hash, 0 if none
Returns
Hash value

◆ hash() [2/2]

static ulong hash ( const T &  data,
ulong  seed = 0 
)
inlinestatic

Compute hash value from data.

  • This uses T::hash() method, for POD types this uses H::hash()
Parameters
dataData to use
seedSeed value for chaining from a previous hash, 0 if none
Returns
Hash value

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