Пример #1
0
unsigned get_homedir_hash_value(char *name)
{
    unsigned int hash = 0;

    if (name == NULL || name[0] == '\0') {
        
        log_error_time();
        fprintf(stderr, "Attempt to hash NULL or empty string!\n");
        return 0;
    }

    hash = boa_hash(name);
    hash %= PASSWD_HASHTABLE_SIZE;

    return hash;
}
Пример #2
0
unsigned get_mime_hash_value(char *extension)
{
    unsigned int hash = 0;

    if (extension == NULL || extension[0] == '\0') {
        
        log_error_time();
        fprintf(stderr, "Attempt to hash NULL or empty string!\n");
        return 0;
    }

    hash = boa_hash(extension);
    hash %= MIME_HASHTABLE_SIZE;

    return hash;
}
Пример #3
0
static unsigned get_homedir_hash_value(const char *name)
{
    return boa_hash(name) % PASSWD_HASHTABLE_SIZE;
}
Пример #4
0
unsigned get_mime_hash_value(const char *extension)
{
    return boa_hash(extension) % MIME_HASHTABLE_SIZE;
}