From 4cda4ed4a1cda53eb47d0a7a5712033e21f04b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Thu, 28 Apr 2016 21:00:33 +0300 Subject: [PATCH] some magic with hash --- src/tox.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tox.py b/src/tox.py index fef6bfc..1c2f22b 100644 --- a/src/tox.py +++ b/src/tox.py @@ -1017,7 +1017,7 @@ class Tox(object): # ----------------------------------------------------------------------------------------------------------------- @staticmethod - def hash(data, hash=None): + def hash(data, size, hash=None): """ Generates a cryptographic hash of the given data. @@ -1034,7 +1034,7 @@ class Tox(object): """ if hash is None: hash = create_string_buffer(TOX_HASH_LENGTH) - Tox.libtoxcore.tox_hash(hash, c_char_p(data), c_size_t(len(data))) + Tox.libtoxcore.tox_hash(hash, c_void_p(data), c_size_t(size)) return bin_to_string(hash, TOX_HASH_LENGTH) def file_control(self, friend_number, file_number, control):