*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> hash32_str (9)              
Title
Content
Arch
Section
 

HASH(9)

Contents


NAME    [Toc]    [Back]

     hash, hash32_buf, hash32_str, hash32_strn - kernel hash functions

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/hash.h>

     uint32_t
     hash32_buf(const void *buf, size_t len, uint32_t ihash);

     uint32_t
     hash32_str(const void *buf, uint32_t ihash);

     uint32_t
     hash32_strn(const void *buf, size_t len, uint32_t ihash);

DESCRIPTION    [Toc]    [Back]

     The hash functions returns a hash of the given buffer.

     The hash32_buf() function returns a 32 bit hash of buf, which is len
     bytes long, seeded with an initial hash of ihash (which is usually
     HASH32_BUF_INIT).  This function may use a different algorithm to
     hash32_str() and hash32_strn().

     The hash32_str() function returns a 32 bit hash of buf, which is a NUL
     terminated ASCII string, seeded with an initial hash of ihash (which is
     usually HASH32_STR_INIT).  This function must use the same algorithm as
     hash32_strn(), so that the same data returns the same hash.

     The hash32_strn() function returns a 32 bit hash of buf, which is a NUL
     terminated ASCII string, up to a maximum of len bytes, seeded with an
     initial hash of ihash (which is usually HASH32_STR_INIT).  This function
     must use the same algorithm as hash32_str(), so that the same data
     returns the same hash.

     The ihash parameter is provided to allow for incremental hashing by
     allowing successive calls to use a previous hash value.

RETURN VALUES    [Toc]    [Back]

     The hash32_* functions return a 32 bit hash of the provided buffer.

HISTORY    [Toc]    [Back]

     The kernel hashing API first appeared in NetBSD 1.6.

BSD                            December 5, 2001                            BSD
[ Back ]
 Similar pages
Name OS Title
MD2_Final Tru64 MD2, MD4, and MD5 hash functions
MD5_Final OpenBSD MD2, MD4, and MD5 hash functions
MD5_Update Tru64 MD2, MD4, and MD5 hash functions
MD5_Update OpenBSD MD2, MD4, and MD5 hash functions
MD2_Init Tru64 MD2, MD4, and MD5 hash functions
md5 Tru64 MD2, MD4, and MD5 hash functions
MD2 Tru64 MD2, MD4, and MD5 hash functions
MD4_Init Tru64 MD2, MD4, and MD5 hash functions
MD5 Tru64 MD2, MD4, and MD5 hash functions
MD4_Update Tru64 MD2, MD4, and MD5 hash functions
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service