Euphoria
Public Member Functions | Public Attributes | List of all members
eu::core::HashCombiner Struct Reference

A utility for combining hash values of multiple objects into a single hash value. More...

Public Member Functions

template<typename T >
HashCombinercombine (const T &t)
 Combines the hash of the given object with the current result.
 

Public Attributes

std::size_t result = 17
 

Detailed Description

A utility for combining hash values of multiple objects into a single hash value.

Note
Do not use when hashing is critical.

Definition at line 25 of file hash.h.

Member Function Documentation

◆ combine()

template<typename T >
HashCombiner & eu::core::HashCombiner::combine ( const T t)
inline

Combines the hash of the given object with the current result.

src: https://stackoverflow.com/a/17017281/180307 numbers from: https://stackoverflow.com/a/1646913/180307

Note
A word of warning, this is (a variation of) the Berstein hash, and because nobody knows why it does well in tests it is not advisable when hashing is critical. See https://github.com/mignon-p/jsw-libs/blob/master/Tutorials/jsw_tut_hashing.md

Definition at line 38 of file hash.h.

Member Data Documentation

◆ result

std::size_t eu::core::HashCombiner::result = 17

Definition at line 27 of file hash.h.


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