Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Mirrors the standard `hashlib` interface for data streams.
```python
from keyedstablehash import siphash24

secret_key = b"\x01" * 16

s = siphash24(key=secret_key)
s.update(b"chunk_one")
s.update(b"chunk_two")
Expand All @@ -107,15 +109,19 @@ import pandas as pd
import pyarrow as pa
from keyedstablehash import hash_pandas_series, hash_arrow_array

secret_key = b"\x01" * 16

# --- Pandas ---
df = pd.DataFrame({"user_id": ["u1", "u2", "u1"]})
df["hash"] = hash_pandas_series(df["user_id"], key=secret_key)
# Result: A Series of uint64 hashes
print(df["hash"])

# --- PyArrow ---
arr = pa.array(["alpha", "beta", "gamma"])
hashes = hash_arrow_array(arr, key=secret_key)
# Result: A pyarrow.Array(uint64)
print(hashes)

```

Expand Down
37 changes: 0 additions & 37 deletions pyproject.toml

This file was deleted.

7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

setup(
name="keyedstablehash",
version="0.0.1",
version="0.0.4",
description="Stable, keyed hashing for Python objects and columnar data. Think `stablehash`, but with SipHash-like keyed PRF semantics so hashes are deterministic for a given key and resistant to adversarial inputs.",
long_description=open("Readme.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
author="Shlok Tadilkar",
author_email="shloktadilkar@gmail.com",
url="https://github.com/shloktech/keyedstablehash",
project_urls={
"Source": "https://github.com/shloktech/keyedstablehash",
"Tracker": "https://github.com/shloktech/keyedstablehash/issues",
"Documentation": "https://github.com/shloktech/keyedstablehash#readme",
},
packages=find_packages(where="src"),
package_dir={"": "src"},
include_package_data=True,
Expand Down