| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 1.91

 

sym_hash

#include "sflsymb.h"
int
sym_hash (
    const char *name)

Synopsis

Computes the hash value for a null-delimited string. The algorithm used is a simple 8-bit checksum of the characters in the string. The hash is within the range 0 .. SYM_HASH_SIZE - 1.

Source Code - (sflsymb.c)

{
    int
        hash;                           /*  Computed hash value              */

    for (hash = 0; *name; name++)
        hash += *name;

    return (hash & (SYM_HASH_SIZE - 1));
}

| << | < | > | >> iMatix Copyright © 1996-98 iMatix