File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments