Reference

rbuf_hash(3)

string hash functions optimized for rbufs

NAME

rbuf_hash, rbuf_hash2 - string hash functions optimized for rbufs

SYNOPSIS

#include <roy.h>

unsigned long int rbuf_hash (RBuf *buf); unsigned long int rbuf_hash2 (RBuf *buf);

DESCRIPTION

The rubf_hash(3) routine is a reimplementation of the x31 hash routine used by glib and other libraries.

The rbuf_hash2(3) routine is an optimized version of the rbuf_hash(3) code, which works for us. Programmers should only use this routine if rbuf_hash(3) isn't fast enough, which it should be for most things.

RETURN VALUE

These function return a hash value created from hashing the contents of buf.

ERRORS

Calls to rbuf_hash(3) and rbuf_hash2(3) can never fail.

MACRO

These calls are implemented using functions.

SEE ALSO

rbuf(3), rbuf_append(3), rbuf_append_char(3), rbuf_append_data(3), rbuf_append_rbuf(3), rbuf_append_sprintf(3), rbuf_append_str(3), rbuf_append_vsprintf(3), rbuf_auto(3), rbuf_down(3), rbuf_empty(3), rbuf_equal(3), rbuf_equal_data(3), rbuf_equal_rbuf(3), rbuf_equal_rbuf_len(3), rbuf_equal_rbufcase(3), rbuf_equal_str(3), rbuf_equal_str_len(3), rbuf_equal_strcase(3), rbuf_erase(3), rbuf_float(3), rbuf_free(3), rbuf_insert(3), rbuf_last(3), rbuf_len(3), rbuf_long(3), rbuf_new(3), rbuf_new_with_sprintf(3), rbuf_own(3), rbuf_prepend(3), rbuf_prepend_char(3), rbuf_prepend_data(3), rbuf_prepend_rbuf(3), rbuf_prepend_str(3), rbuf_rdonly(3), rbuf_set_to(3), rbuf_split(3), rbuf_sprintf(3), rbuf_str(3), rbuf_truncate(3), rbuf_up(3), roy(3)

History