Skip to content

Commit bf41800

Browse files
committed
0.0.195
1 parent da0e6b5 commit bf41800

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

orso/cityhash/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
21
def CityHash32(data: bytes) -> int:
3-
from opteryx.third_party.cyan4973.xxhash import hash_bytes
2+
from xxhash import xxh32
3+
44
if not isinstance(data, bytes):
55
data = str(data).encode()
6-
return hash_bytes(data) & 0xFFFFFFFF
6+
return xxh32(data)
7+
78

89
def CityHash64(data: bytes) -> int:
9-
from opteryx.third_party.cyan4973.xxhash import hash_bytes
10+
from xxhash import xxh64
11+
1012
if not isinstance(data, bytes):
1113
data = str(data).encode()
12-
return hash_bytes(data) & 0xFFFFFFFFFFFFFFFF
14+
return xxh64(data)

orso/dataframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,11 @@ def schema(self) -> RelationSchema:
421421
return self._schema
422422

423423
def __hash__(self):
424-
from opteryx.third_party.cyan4973.xxhash import hash_bytes
424+
from xxhash import xxh64
425425

426426
_hash = 0
427427
for i, row in enumerate(self._rows):
428-
row_hash = hash_bytes(str(row).encode())
428+
row_hash = xxh64(str(row).encode())
429429
_hash = i ^ _hash ^ row_hash
430430
return _hash
431431

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
data-expectations>=1.6.0
22
orjson
33
ormsgpack
4-
opteryx>=0.20.0
54
pandas
65
pyarrow
7-
numpy
6+
numpy
7+
xxhash

0 commit comments

Comments
 (0)