<commit_before>/*
 * hashfaq6.c, part of "klib" project.
 *
 *  Created on: 24.05.2015, 03:25
 *      Author: <NAME> <<EMAIL>>
 */

#include "hash.h"

static unsigned hash = 0;

unsigned hash_faq6( unsigned startval, const void * buf, size_t size )
{
    for( hash = startval; size; size--, (unsigned char *)buf++ )
    {
        hash += *((unsigned char *)buf);
        hash += (hash << 10);
        hash ^= (hash >> 6);
    }
    hash += (hash << 3);
    hash ^= (hash >> 11);
    hash += (hash << 15);
    return hash;
}

unsigned shash_faq6( unsigned startval, const char * buf )
{
    for( hash = startval; *buf; buf++ )
    {
        hash += *((unsigned char *)buf);
        hash += (hash << 10);
        hash ^= (hash >> 6);
    }
    hash += (hash << 3);
    hash ^= (hash >> 11);<commit_msg>buf = (unsigned char  *)buf + 1;<commit_after>/*
 * hashfaq6.c, part of "klib" project.
 *
 *  Created on: 24.05.2015, 03:25
 *      Author: <NAME> <<EMAIL>>
 */

#include "hash.h"

static unsigned hash = 0;

unsigned hash_faq6( unsigned startval, const void * buf, size_t size )
{
    for( hash = startval; size; size-- )
    {
        hash += *((unsigned char *)buf);
        hash += (hash << 10);
        hash ^= (hash >> 6);
        buf = (unsigned char  *)buf + 1;
    }
    hash += (hash << 3);
    hash ^= (hash >> 11);
    hash += (hash << 15);
    return hash;
}

unsigned shash_faq6( unsigned startval, const char * buf )
{
    for( hash = startval; *buf; buf++ )
    {
        hash += *((unsigned char *)buf);
        hash += (hash << 10);
        hash ^= (hash >> 6);
    }
    hash += (hash << 3);
    hash ^= (hash >> 11);
{'fraction_non_alphanumeric': 0.19070904645476772, 'fraction_numerical': 0.037897310513447434, 'mean_word_length': 2.203522504892368, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3126313', 'n_tokens_mistral': 631, 'n_tokens_neox': 579, 'n_words': 175}