https://github.com/realorangeone/seahash-py
Python bindings to seahash
https://github.com/realorangeone/seahash-py
hash python seahash
Last synced: 3 months ago
JSON representation
Python bindings to seahash
- Host: GitHub
- URL: https://github.com/realorangeone/seahash-py
- Owner: RealOrangeOne
- License: mit
- Created: 2022-06-29T07:55:58.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T21:50:55.000Z (about 1 year ago)
- Last Synced: 2024-05-29T12:46:35.578Z (about 1 year ago)
- Topics: hash, python, seahash
- Language: Rust
- Homepage: https://pypi.org/project/seahash/
- Size: 60.5 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SeaHash
[](https://github.com/RealOrangeOne/seahash-py/actions/workflows/ci.yml)




Python bindings to [`seahash`](https://docs.rs/seahash/) - A blazingly fast, portable hash function with proven statistical guarantees.
## Installation
```
pip install seahash
```Wheels should be available for most platforms. If you need a wheel which isn't provided, [raise an issue](https://github.com/RealOrangeOne/seahash-py/issues).
Compiling from source will require a Rust toolchain.
## Usage
Hashing can be done in 2 ways:
### Primitive functions
```python
import seahash# Plain hash
seahash.hash(b"123")# Hash with custom seeds
seahash.hash_seeded(b"123", 4, 5, 6, 7)
```Both methods return an `int`.
### `hashlib`-compatible class
For convenience, a `hashlib`-compatible class is provided:
```python
import seahashs = seahash.SeaHash()
s.update(b"123")
s.digest()
s.hexdigest()
```The underlying `int` digest can be obtained with `intdigest`.