Skip to content

Commit 7e53681

Browse files
committed
IGNITE-14059: Fix comments
1 parent 42df688 commit 7e53681

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pyignite/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def hashcode(data: Union[str, bytes]) -> int:
110110
"""
111111
Calculate hash code used for identifying objects in Ignite binary API.
112112
113-
:param string: UTF-8-encoded string identifier of binary buffer,
113+
:param data: UTF-8-encoded string identifier of binary buffer or byte array
114114
:return: hash code.
115115
"""
116116
if isinstance(data, str):
@@ -127,8 +127,11 @@ def hashcode(data: Union[str, bytes]) -> int:
127127
pass
128128
else:
129129
"""
130-
For byte array we iterate over bytes which only take 1 byte and can
131-
be negative. For this reason we use ctypes.c_byte() to
130+
For byte array we iterate over bytes which only take 1 byte. But
131+
according to protocol, bytes during hashing should be treated as signed
132+
integer numbers 8 bits long. On other hand elements in Python's `bytes`
133+
are unsigned. For this reason we use ctypes.c_byte() to make them
134+
signed.
132135
"""
133136
result = 1
134137
for byte in data:

0 commit comments

Comments
 (0)