Skip to main content

Google FarmHash Bindings for Python

Project description

python-farmhash
==========


Overview
========
This package provides bindings for the [Google's FarmHash](http://code.google.com/p/farmhash/).

Code specific to this project is covered by [The MIT License](http://opensource.org/licenses/MIT)

Forked on 2015.04.06 to add bindings for fingerprint functions. Pull request submitted.
Install
=======
Currently, clone the repo and:

Linux:
> $ cd python-farmhash
> $ sudo python setup.py Install

Windows:
(Sheer hackery. I'm sure there's a way to do this with the new VS but this is working and
I don't have hours to work on it. Feel free to submit a pull request)

> Install Microsoft Visual C++ Compiler for Python 2.7
http://www.microsoft.com/en-us/download/details.aspx?id=44266
> Install msinttypes https://code.google.com/p/msinttypes/
> Copy stdint.h to the src directory, and modify the farmhash.cc line 47 reference to use double quotes instead of angle brackets
> Add "if defined(_MSC_VER) ||" to line 76 of farmhash.cc
> $ cd python-farmhash
> $ sudo python setup.py install

Usage
=====
The library is pretty simple to use:

> import farmhash
> print farmhash.hash64('abc')
> 2640714258260161385

For more details, use ipython:
> In [1]: import farmhash
>
> In [2]: farmhash.hash64withseed?
> Type: builtin_function_or_method
> String Form:<built-in function hash64withseed>
> Docstring:
> Hash function for a string. For convenience, a 64-bit seed is also hashed into the result.
> example: print farmhash.hash64withseed('abc', 12345)
> 13914286602242141520L

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfarmhash-0.2.2.tar.gz (99.3 kB view details)

Uploaded Source

File details

Details for the file pyfarmhash-0.2.2.tar.gz.

File metadata

  • Download URL: pyfarmhash-0.2.2.tar.gz
  • Upload date:
  • Size: 99.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyfarmhash-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6d076f744347beafd413f76c0e429b502cddd821231a6f150abdb14e35a7328c
MD5 8f181d1e2ce6f5010a64b8e248da5f5c
BLAKE2b-256 3185303d07e39cf506af7b0da997eee5f3b1ecbfb8ade0370ed5c0f4f96d8c96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page