Skip to main content

Hashing Python code

Project description



Install and update using Pip.

pip install -U codehash

A simple example

from codehash import hash_function

dct = {'a': 1}

def f(x):
    return 1 + dct["param"]

h1 = hash_function(f)

def f(x):
    return 1 + dct["param"]  # comment

h2 = hash_function(f)

dct = {'a': 2}

def f(x):
    return 1 + dct["param"]

h3 = hash_function(f)

assert h1 == h2
assert h1 != h3

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

codehash-0.1.0.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

codehash-0.1.0-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

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