libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_hash.h File Reference

Go to the source code of this file.

Macros

#define gblHash
 

Functions

uint16_t gblHashCrc16BitPartial (const void *pData, size_t size, uint16_t *pPartial)
 
Fixed data sizes

Methods for calculating the hash of primitive types

GblHash gblHash32Bit (uint32_t value)
 
uint32_t gblUnhash32Bit (GblHash hash)
 
GblHash gblHash16Bit (uint16_t value)
 
Arbitrarily-sized data

Methods for calculating the hash of generic buffers

GblHash gblHashSip (const void *pData, size_t size)
 
GblHash gblHashMurmur (const void *pData, size_t size)
 
GblHash gblHashFnv1 (const void *pData, size_t size)
 
GblHash gblHashXx (const void *pData, size_t size)
 
GblHash gblHashSuperFast (const void *pData, size_t size)
 
GblHash gblHashPearson (const void *pData, size_t size)
 
GblHash gblHashJenkins (const void *pData, size_t size)
 
GblHash gblHashCrc (const void *pData, size_t size)
 
GblHash gblHashSha1 (const void *pData, size_t size)
 
GblHash gblHashMd5 (const void *pData, size_t size)
 

Detailed Description

Collection of hashing algorithms.

This file contains the hashing API, which is a collection of various hashing algorithms for calculating the hashes of either arbitrary buffers of data or primitive types of specific sizes.

Author
2023 Falco Girgis

Definition in file gimbal_hash.h.

Macro Definition Documentation

◆ gblHash

#define gblHash

Default hashing algorithm used internally by libGimbal.

Definition at line 27 of file gimbal_hash.h.

Function Documentation

◆ gblHash32Bit()

GblHash gblHash32Bit ( uint32_t  value)

Calculate the hash of a given 32-bit value.

◆ gblUnhash32Bit()

uint32_t gblUnhash32Bit ( GblHash  hash)

Retrieve original 32-bit value from its hash.

◆ gblHash16Bit()

GblHash gblHash16Bit ( uint16_t  value)

Calculate the hash of the given 16-bit value.

◆ gblHashCrc16BitPartial()

uint16_t gblHashCrc16BitPartial ( const void *  pData,
size_t  size,
uint16_t *  pPartial 
)

Calculates the hash of a given buffer continuing the partial hash from a previous iteration (or taking NULL for none)

◆ gblHashSip()

GblHash gblHashSip ( const void *  pData,
size_t  size 
)

Returns the hash of the given data buffer, calculated using the SIP algorithm.

◆ gblHashMurmur()

GblHash gblHashMurmur ( const void *  pData,
size_t  size 
)

Returns the hash of the given data buffer, calculated using the MurmurHash32 algorithm.

◆ gblHashFnv1()

GblHash gblHashFnv1 ( const void *  pData,
size_t  size 
)

Returns the hash of the given data buffer, calculated using the a custom FNV1 algorithm.

◆ gblHashXx()

GblHash gblHashXx ( const void *  pData,
size_t  size 
)

Returns the hash of the given data buffer, calculated using the xxHash algorithm.

◆ gblHashSuperFast()

GblHash gblHashSuperFast ( const void *  pData,
size_t  size 
)

Returns the hash of the given data buffer, calculated using the SuperFastHash algorithm.

◆ gblHashPearson()

GblHash gblHashPearson ( const void *  pData,
size_t  size 
)

Returns the hash of the given data buffer, calculated using the Pearson hashing algorithm.

◆ gblHashJenkins()

GblHash gblHashJenkins ( const void *  pData,
size_t  size 
)

Returns the hash of the given data buffer, calculated using the Jenkins hashing algorithm.

◆ gblHashCrc()

GblHash gblHashCrc ( const void *  pData,
size_t  size 
)

Returns the CRC value of the given data buffer.

◆ gblHashSha1()

GblHash gblHashSha1 ( const void *  pData,
size_t  size 
)

Returns the SHA1 hash calculated for the given data buffer.

◆ gblHashMd5()

GblHash gblHashMd5 ( const void *  pData,
size_t  size 
)

Returns the MD5 hash calculated for the given data buffer.