hash.h File Reference
#include "psptypes.h"
Include dependency graph for hash.h:

Data Structures

struct HASHCTX

Macros

#define HASH_VALUE uint64_t
#define RDM_NUM_HASH_NUMBERS 8

Functions

void hashFcnStart (HASHCTX *hashfcn)
void hashFcnEmit (HASHCTX *hashfcn, uint8_t ch)
uint64_t hashFcnFinish (const HASHCTX *hashfcn)
uint64_t hashValue (uint8_t *values, uint32_t size)

Macro Definition Documentation

HASH_VALUE

#define HASH_VALUE uint64_t

RDM_NUM_HASH_NUMBERS

#define RDM_NUM_HASH_NUMBERS 8

Function Documentation

hashFcnEmit()

void hashFcnEmit ( HASHCTX * hashfcn,
uint8_t ch
)
inline
556 {
557 hashfcn->hash ^= hashNumbers[ch][hashfcn->offset++ % RDM_NUM_HASH_NUMBERS];
558 }

References HASHCTX::hash.

Referenced by hashValue().

Here is the caller graph for this function:

hashFcnFinish()

uint64_t hashFcnFinish ( const HASHCTX * hashfcn )
inline
561 {
562return hashfcn->hash;
563 }

References HASHCTX::hash.

Referenced by hashValue().

Here is the caller graph for this function:

hashFcnStart()

void hashFcnStart ( HASHCTX * hashfcn )
inline
550 {
551 hashfcn->hash = 0;
552 hashfcn->offset = 0;
553 }

References HASHCTX::hash, and HASHCTX::offset.

Referenced by hashValue().

Here is the caller graph for this function:

hashValue()

uint64_t hashValue ( uint8_t * values,
uint32_t size
)
inline
Examples
cpp50Example_main.cpp.
566 {
567HASHCTX h;
568hashFcnStart (&h);
569for (uint32_t i = 0; i < size; i++)
570 {
571hashFcnEmit (&h, values[i]);
572 }
573
574return hashFcnFinish (&h);
575 }

References hashFcnEmit(), hashFcnFinish(), and hashFcnStart().

Here is the call graph for this function:
void hashFcnStart(HASHCTX *hashfcn)
Definition: hash.h:549
Definition: hash.h:24
void hashFcnEmit(HASHCTX *hashfcn, uint8_t ch)
Definition: hash.h:555
#define RDM_NUM_HASH_NUMBERS
Definition: hash.h:33
uint32_t offset
Definition: hash.h:25
uint64_t hashFcnFinish(const HASHCTX *hashfcn)
Definition: hash.h:560
uint64_t hash
Definition: hash.h:26