Skip to content

uvhttp_hash.h ​

Hash algorithm interface based on xxHash.

This module provides high-performance hash functions using xxHash algorithm. All functions are inline-optimized for zero runtime overhead.

Functions ​

uvhttp_hash(const void *data, size_t length, uint64_t seed) ​

Return Type: uint64_t

Compute hash value for arbitrary data.

Parameters:

  • data: Pointer to data buffer to hash
  • length: Length of data in bytes
  • seed: Seed value for hash computation

Returns: uint64_t Hash value (0 if data is NULL)

Note: This function is inline-optimized for performance Note: Uses xxHash's 64-bit algorithm (XXH64)

uvhttp_hash_string(const char *str) ​

Return Type: uint64_t

Compute hash value for null-terminated string.

Parameters:

  • str: Null-terminated string to hash

Returns: uint64_t Hash value (0 if str is NULL)

Note: Uses default seed (UVHTTP_HASH_DEFAULT_SEED) Note: String length is computed internally using strlen()

uvhttp_hash_default(const void *data, size_t length) ​

Return Type: uint64_t

Compute hash value using default seed.

Parameters:

  • data: Pointer to data buffer to hash
  • length: Length of data in bytes

Returns: uint64_t Hash value using UVHTTP_HASH_DEFAULT_SEED

Note: Convenience wrapper forwith default seed

uvhttp_hash_string_default(const char *str) ​

Return Type: uint64_t

Compute string hash using default seed.

Parameters:

  • str: Null-terminated string to hash

Returns: uint64_t Hash value using UVHTTP_HASH_DEFAULT_SEED

Note: Convenience wrapper for

Released under MIT License