File tree Expand file tree Collapse file tree 5 files changed +64
-0
lines changed Expand file tree Collapse file tree 5 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " py-gxhash"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+
6
+ [lib ]
7
+ name = " gxhash"
8
+ crate-type = [" cdylib" ]
9
+
10
+ [dependencies ]
11
+ pyo3 = " 0.22.0"
12
+ gxhash = { path = " .." , features = [" hybrid" ] }
Original file line number Diff line number Diff line change
1
+ # py-gxhash
2
+
3
+ ``` bash
4
+ uv venv --seed
5
+ uv run maturin develop
6
+ ```
Original file line number Diff line number Diff line change
1
+ def gxhash32 (input : bytes , seed : int ) -> int : ...
2
+ def gxhash64 (input : bytes , seed : int ) -> int : ...
3
+ def gxhash128 (input : bytes , seed : int ) -> int : ...
Original file line number Diff line number Diff line change
1
+ [build-system ]
2
+ requires = [" maturin>=1.7,<2.0" ]
3
+ build-backend = " maturin"
4
+
5
+ [project ]
6
+ name = " gxhash"
7
+ requires-python = " >=3.7"
8
+ dynamic = [" version" ]
9
+ classifiers = [
10
+ " Programming Language :: Rust" ,
11
+ " Programming Language :: Python :: Implementation :: CPython" ,
12
+ " Programming Language :: Python :: Implementation :: PyPy" ,
13
+ ]
14
+
15
+ [tool .maturin ]
16
+ features = [" pyo3/extension-module" ]
17
+
18
+ [dependency-groups ]
19
+ dev = [" maturin>=1.7.4" ]
Original file line number Diff line number Diff line change
1
+ use pyo3:: prelude:: * ;
2
+
3
+ #[ pyfunction]
4
+ fn gxhash32 ( input : & [ u8 ] , seed : i64 ) -> PyResult < u32 > {
5
+ Ok ( gxhash:: gxhash32 ( input, seed) )
6
+ }
7
+
8
+ #[ pyfunction]
9
+ fn gxhash64 ( input : & [ u8 ] , seed : i64 ) -> PyResult < u64 > {
10
+ Ok ( gxhash:: gxhash64 ( input, seed) )
11
+ }
12
+
13
+ #[ pyfunction]
14
+ fn gxhash128 ( input : & [ u8 ] , seed : i64 ) -> PyResult < u128 > {
15
+ Ok ( gxhash:: gxhash128 ( input, seed) )
16
+ }
17
+
18
+ #[ pymodule( name = "gxhash" ) ]
19
+ fn pygxhash ( m : & Bound < ' _ , PyModule > ) -> PyResult < ( ) > {
20
+ m. add_function ( wrap_pyfunction ! ( gxhash32, m) ?) ?;
21
+ m. add_function ( wrap_pyfunction ! ( gxhash64, m) ?) ?;
22
+ m. add_function ( wrap_pyfunction ! ( gxhash128, m) ?) ?;
23
+ Ok ( ( ) )
24
+ }
You can’t perform that action at this time.
0 commit comments