<commit_before>/* HashKit
 * Copyright (C) 2009 <NAME>
 * All rights reserved.
 *
 * Use and distribution licensed under the BSD license.  See
 * the COPYING file in the parent directory for full text.
 */

#include "common.h"

/* FNV hash'es lifted from Dustin Sallings work */
static uint64_t FNV_64_INIT= UINT64_C(0xcbf29ce484222325);
static uint64_t FNV_64_PRIME= UINT64_C(0x100000001b3);
static uint32_t FNV_32_INIT= 2166136261UL;
static uint32_t FNV_32_PRIME= 16777619;

uint32_t hashkit_fnv1_64(const char *key, size_t key_length)
{
  /* Thanks to <EMAIL> for the pointer */
  uint64_t hash= FNV_64_INIT;
  size_t x= 0;

  for (x= 0; x < key_length; x++)
  {
    hash *= FNV_64_PRIME;
    hash ^= (uint64_t)key[x];
  }

  return (uint32_t)hash;
}

uint32_t hashkit_fnv1a_64(const char *key, size_t key_length)
{
  uint32_t hash= (uint32_t) FNV_64_INIT;
  size_t x= 0;

  for (x= 0; x < key_length; x++)
  {
    uint32_t val= (uint32_t)key[x];
    hash ^= val;
    hash *= (uint32_t) FNV_64_PRIME;
  }

  return hash;
}

uint32_t hashkit_fnv1_32(const char *key, size_t key_length)
{
  uint32_t hash= FNV_32_INIT;
  size_t x= 0;

  for (x= 0; x < key_length; x++)
  {
    uint32_t val= (uint32_t)key[x];
    hash *= FNV_32_PRIME;
    hash ^= val;
  }

  return hash;
}

uint32_t hashkit_fnv1a_32(const char *key, size_t key_length)
{
  uint32_t hash= FNV_32_INIT;
  size_t x= 0;

  for (x= 0; x < key_length; x++)
  {<commit_msg>Small cleanup for loop.<commit_after>/* HashKit
 * Copyright (C) 2009 <NAME>
 * All rights reserved.
 *
 * Use and distribution licensed under the BSD license.  See
 * the COPYING file in the parent directory for full text.
 */

#include "common.h"

/* FNV hash'es lifted from Dustin Sallings work */
static uint64_t FNV_64_INIT= UINT64_C(0xcbf29ce484222325);
static uint64_t FNV_64_PRIME= UINT64_C(0x100000001b3);
static uint32_t FNV_32_INIT= 2166136261UL;
static uint32_t FNV_32_PRIME= 16777619;

uint32_t hashkit_fnv1_64(const char *key, size_t key_length)
{
  /* Thanks to <EMAIL> for the pointer */
  uint64_t hash= FNV_64_INIT;

  for (size_t x= 0; x < key_length; x++)
  {
    hash *= FNV_64_PRIME;
    hash ^= (uint64_t)key[x];
  }

  return (uint32_t)hash;
}

uint32_t hashkit_fnv1a_64(const char *key, size_t key_length)
{
  uint32_t hash= (uint32_t) FNV_64_INIT;

  for (size_t x= 0; x < key_length; x++)
  {
    uint32_t val= (uint32_t)key[x];
    hash ^= val;
    hash *= (uint32_t) FNV_64_PRIME;
  }

  return hash;
}

uint32_t hashkit_fnv1_32(const char *key, size_t key_length)
{
  uint32_t hash= FNV_32_INIT;

  for (size_t x= 0; x < key_length; x++)
  {
    uint32_t val= (uint32_t)key[x];
    hash *= FNV_32_PRIME;
    hash ^= val;
  }

  return hash;
}

uint32_t hashkit_fnv1a_32(const char *key, size_t key_length)
{
  uint32_t hash= FNV_32_INIT;

  for (size_t x= 0; x < key_length; x++)
  {
{'fraction_non_alphanumeric': 0.11481741573033707, 'fraction_numerical': 0.09058988764044944, 'mean_word_length': 3.87008547008547, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '3550898', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1235, 'n_words': 309}