hash.h File Reference

Hash functions. More...

+ Include dependency graph for hash.h:

Go to the source code of this file.

Functions

ARCH_API uint32_t ArchHash (const char *data, size_t len)
 Hash len bytes of data. More...
 
ARCH_API uint32_t ArchHash (const char *data, size_t len, uint32_t seed)
 
ARCH_API uint64_t ArchHash64 (const char *data, size_t len)
 Hash len bytes of data. More...
 
ARCH_API uint64_t ArchHash64 (const char *data, size_t len, uint64_t seed)
 

Detailed Description

Hash functions.

Definition in file hash.h.

Function Documentation

◆ ArchHash() [1/2]

ARCH_API uint32_t ArchHash ( const char *  data,
size_t  len 
)

Hash len bytes of data.

To compute a hash value for data that is not contiguous in memory, iterate over all the contiguous blocks of memory and accumulate the hash value by passing it on as seed. Note that this is not equivalent to hashing the contiguous pieces as a whole. Support for that may be added in future.

◆ ArchHash() [2/2]

ARCH_API uint32_t ArchHash ( const char *  data,
size_t  len,
uint32_t  seed 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ArchHash64() [1/2]

ARCH_API uint64_t ArchHash64 ( const char *  data,
size_t  len 
)

Hash len bytes of data.

To compute a hash value for data that is not contiguous in memory, iterate over all the contiguous blocks of memory and accumulate the hash value by passing it on as seed. Note that this is not equivalent to hashing the contiguous pieces as a whole. Support for that may be added in future.

◆ ArchHash64() [2/2]

ARCH_API uint64_t ArchHash64 ( const char *  data,
size_t  len,
uint64_t  seed 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.