<commit_before>cdef extern from "<stdint.h>" nogil:
    ctypedef unsigned long long uint64_t

cdef extern from "fnv1a.h":
    void fnv1a(const char *foo, const int length, uint64_t *hash);

cdef class fnv1a64:
    cdef readonly uint64_t h

    def __cinit__(self, s=None):
        self.h = <uint64_t>0
        if s is not None:
            fnv1a(s, len(s), &self.h)

    cpdef void update(self, const char *s):
        fnv1a(s, len(s), &self.h)

    cpdef unsigned long long digest(self):
        return self.h

    cpdef char * hexdigest(self):
        return b'%x' % self.h<commit_msg>Make fnv object more like hashlib hashes<commit_after>cdef extern from "<stdint.h>" nogil:
    ctypedef unsigned long long uint64_t

cdef extern from "fnv1a.h":
    void fnv1a(const char *foo, const int length, uint64_t *hash)

cdef class fnv1a64:

    cdef readonly uint64_t h
    name        = "fnv1a64"
    digestsize  = 8
    digest_size = 8

    def __cinit__(self, s=None):
        self.h = <uint64_t>0
        if s is not None:
            fnv1a(s, len(s), &self.h)

    cpdef void update(self, const char *s):
        fnv1a(s, len(s), &self.h)

    cpdef unsigned long long digest(self):
        return self.h

    cpdef char * hexdigest(self):
        return b'%x' % self.h

    cpdef void reset(self):
        self.h = <uint64_t>0
{'fraction_non_alphanumeric': 0.10625470987189148, 'fraction_numerical': 0.03014318010550113, 'mean_word_length': 2.522546419098143, 'pattern_counts': {'":': 2, '<': 8, '<?xml version=': 0, '>': 8, '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': '4169993', 'n_tokens_mistral': 518, 'n_tokens_neox': 489, 'n_words': 146}