Skip to main content

No project description provided

Project description

gxhash-py

Python bindings for GxHash, a blazingly fast and robust non-cryptographic hashing algorithm.

Features

  • Blazingly Fast: Minimal-overhead binding to leverage the full speed of GxHash.
  • Zero Python: Pure Rust backend with zero additional Python runtime overhead.
  • Fine-Grained Control: Build true multi-threaded or async hashing pipelines with GIL-free APIs.
  • Faster File Hashing: Hash files using memory-mapped I/O via Rust — 3x faster than Python's sequential I/O.
  • Async-Ready: Tokio-powered async hashing for fast and efficient concurrency.
  • Fully Typesafe: Predictable, clean API with complete type safety.

Installation

pip install gxhash

Usage

Hashing bytes.

from gxhash import GxHash32

def main():
    gxhash = GxHash32(seed=0)
    result = gxhash.hash(b"Hello, world!")

if __name__ == "__main__":
    main()

Hashing bytes asynchronously.

from asyncio import run
from gxhash import GxHash128

async def main():
    gxhash = GxHash128(seed=0)
    result = await gxhash.hash_async(b"Hello, world!")

if __name__ == "__main__":
    run(main())

Hashing a file.

from gxhash import GxHash64

def main():
    gxhash = GxHash64(seed=0)
    file = open("path/to/file.dmg", "rb")
    result = gxhash.hash_file(file)

if __name__ == "__main__":
    main()

Hashing a file asynchronously.

from asyncio import run
from gxhash import GxHash128

async def main():
    gxhash = GxHash128(seed=0)
    file = open("path/to/file.dmg", "rb")
    result = await gxhash.hash_file_async(file)

if __name__ == "__main__":
    run(main())

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

gxhash-0.1.4.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file gxhash-0.1.4.tar.gz.

File metadata

  • Download URL: gxhash-0.1.4.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.6.0

File hashes

Hashes for gxhash-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6472eaccae1e6cccf09f7d0cddffb65375ee3197ed458ec7710d9b61dab2f497
MD5 ad4406a3a2a637290422fdb194a0b0e9
BLAKE2b-256 e1e2366c13e844508a5c5b0914d875a8d90decaca0e31d116c2cb8a2846914dd

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