geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Namespaces | Functions
geopm_hash.cpp File Reference
#include "geopm_hash.h"
#include <string.h>
#include <zlib.h>
#include "geopm/Helper.hpp"
Include dependency graph for geopm_hash.cpp:

Namespaces

 geopm
 

Functions

uint64_t geopm::hash (const std::string &key)
 
uint64_t geopm_crc32_str (const char *key)
 This function is used to produce unique region IDs for named regions. More...
 
uint64_t geopm_crc32_u64 (uint64_t begin, uint64_t key)
 DEPRECATED Implements a hashing algorithm. More...
 

Function Documentation

◆ geopm_crc32_str()

uint64_t geopm_crc32_str ( const char *  key)

This function is used to produce unique region IDs for named regions.

An Agent implementation with specialized behavior for specific region names can use this function to figure out the region ID to expect for the desired region. Only the bottom 32 bits will be filled in, reserving the top 32 bits for hints and other information.

Parameters
[in]keyThis string is hashed to produce a 64-bit value.
Returns
uint64_t The result is returned as a 64-bit integer.

◆ geopm_crc32_u64()

uint64_t geopm_crc32_u64 ( uint64_t  begin,
uint64_t  key 
)

DEPRECATED Implements a hashing algorithm.

Parameters
[in]beginAlgorithm starts with this value
[in]keyThis value is hashed to produce a 32-bit result.
Returns
uint64_t The result is returned as a 64-bit integer.