<commit_before>MetroHash
========

This is a Python wrapper around a C implementation of MetroHash, a fast non-cryptographic hashing algorithm.

To get started, clone this repo and run the setup.py script, or, alternatively

.. code-block:: bash

    pip install -U cython
    pip install git+https://github.com/escherba/metrohash#egg=metrohash-0.0.1


MetroHash64
----------

64-bit implementation of MetroHash algorithm

.. code-block:: python

    >>> from metrohash import MetroHash64, MetroHash128
    >>> MetroHash64("abc")
    17099979927131455419L
    >>> MetroHash128("abc")
    (9920195071304498087L, 2078520654167540133L)
<commit_msg>expand README example<commit_after>MetroHash
========

This is a Python wrapper around a C implementation of MetroHash, a fast non-cryptographic hashing algorithm.

To get started, clone this repo and run the setup.py script, or, alternatively

.. code-block:: bash

    pip install -U cython
    pip install git+https://github.com/escherba/metrohash#egg=metrohash-0.0.1


MetroHash64
----------

64-bit implementation of MetroHash algorithm

.. code-block:: python

    >>> import metrohash
    >>> metrohash.MetroHash64("abc")
    17099979927131455419L
    >>> metrohash.MetroHash128("abc")
    (9920195071304498087L, 2078520654167540133L)
    >>> metrohash.Hash128to64(metrohash.MetroHash128("abc"))
    11756436918765573838L

{'fraction_non_alphanumeric': 0.11499272197962154, 'fraction_numerical': 0.12590975254730713, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, 'https://': 2, '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': '2293861', 'n_tokens_mistral': 552, 'n_tokens_neox': 433, 'n_words': 115}