aboutsummaryrefslogtreecommitdiff
path: root/contrib/scripts/gnunet-chk.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scripts/gnunet-chk.py.in')
-rwxr-xr-xcontrib/scripts/gnunet-chk.py.in8
1 files changed, 2 insertions, 6 deletions
diff --git a/contrib/scripts/gnunet-chk.py.in b/contrib/scripts/gnunet-chk.py.in
index ab0bc635f..0fb591627 100755
--- a/contrib/scripts/gnunet-chk.py.in
+++ b/contrib/scripts/gnunet-chk.py.in
@@ -21,10 +21,6 @@
21# Brief: Computes GNUNET style Content Hash Key for a given file 21# Brief: Computes GNUNET style Content Hash Key for a given file
22# Author: Sree Harsha Totakura 22# Author: Sree Harsha Totakura
23 23
24from builtins import str
25from builtins import range
26from past.utils import old_div
27from builtins import object
28from hashlib import sha512 24from hashlib import sha512
29import logging 25import logging
30import os 26import os
@@ -252,7 +248,7 @@ def compute_chk_offset_(depth, end_offset):
252 bds = compute_tree_size_(depth) 248 bds = compute_tree_size_(depth)
253 if (depth > 0): 249 if (depth > 0):
254 end_offset -= 1 250 end_offset -= 1
255 ret = old_div(end_offset, bds) 251 ret = end_offset // bds
256 return ret % CHK_PER_INODE 252 return ret % CHK_PER_INODE
257 253
258 254
@@ -276,7 +272,7 @@ def compute_iblock_size_(depth, offset):
276 ret = CHK_PER_INODE 272 ret = CHK_PER_INODE
277 else: 273 else:
278 bds /= CHK_PER_INODE 274 bds /= CHK_PER_INODE
279 ret = old_div(mod, bds) 275 ret = mod // bds
280 if (mod % bds) is not 0: 276 if (mod % bds) is not 0:
281 ret += 1 277 ret += 1
282 return ret 278 return ret