ATLAS Offline Software
Loading...
Searching...
No Matches
xxh3 Namespace Reference

Wrapper namespace for our xxhash (xxh3) wrapper function. More...

Functions

std::uint64_t hash64 (const void *data, std::size_t size)
 Passthrough to XXH3_64bits.
template<typename Cont>
std::uint64_t hash64 (const Cont &cont)
 Hash a container with data() and size() members.
template<typename POD, typename = std::enable_if_t<std::is_standard_layout_v<POD> && std::is_trivial_v<POD>>>
std::uint64_t hash64 (const POD &pod)
 Hash a POD value / struct.

Detailed Description

Wrapper namespace for our xxhash (xxh3) wrapper function.

Function Documentation

◆ hash64() [1/3]

template<typename Cont>
std::uint64_t xxh3::hash64 ( const Cont & cont)

Hash a container with data() and size() members.

Examples include std::string, std::vector, std::string_view

Parameters
contContainer to be hashed
Returns
64-bit xxh3 hash of container

Definition at line 39 of file XXH.h.

39 {
40 return hash64(cont.data(), cont.size() * sizeof(typename Cont::value_type));
41}
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
Definition XXH.cxx:9

◆ hash64() [2/3]

template<typename POD, typename = std::enable_if_t<std::is_standard_layout_v<POD> && std::is_trivial_v<POD>>>
std::uint64_t xxh3::hash64 ( const POD & pod)

Hash a POD value / struct.

Parameters
podValue to be hashed
Returns
64-bit xxh3 hash of value

Definition at line 52 of file XXH.h.

52 {
53 return hash64(&pod, sizeof(POD));
54}

◆ hash64() [3/3]

std::uint64_t xxh3::hash64 ( const void * data,
std::size_t size )

Passthrough to XXH3_64bits.

Parameters
dataPointer to data to be hashed
sizeSize of data to be hashed (in bytes)
Returns
64-bit xxh3 hash of data

Definition at line 9 of file XXH.cxx.

9 {
10 return XXH3_64bits(data, size);
11}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits(XXH_NOESCAPE const void *input, size_t length)
64-bit unseeded variant of XXH3.