diff options
Diffstat (limited to 'contrib/scripts/gnunet-chk.py.in')
-rwxr-xr-x | contrib/scripts/gnunet-chk.py.in | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/contrib/scripts/gnunet-chk.py.in b/contrib/scripts/gnunet-chk.py.in index 1f5a0726c..0fb591627 100755 --- a/contrib/scripts/gnunet-chk.py.in +++ b/contrib/scripts/gnunet-chk.py.in | |||
@@ -21,12 +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 | ||
24 | from __future__ import print_function | ||
25 | from __future__ import division | ||
26 | from builtins import str | ||
27 | from builtins import range | ||
28 | from past.utils import old_div | ||
29 | from builtins import object | ||
30 | from hashlib import sha512 | 24 | from hashlib import sha512 |
31 | import logging | 25 | import logging |
32 | import os | 26 | import os |
@@ -254,7 +248,7 @@ def compute_chk_offset_(depth, end_offset): | |||
254 | bds = compute_tree_size_(depth) | 248 | bds = compute_tree_size_(depth) |
255 | if (depth > 0): | 249 | if (depth > 0): |
256 | end_offset -= 1 | 250 | end_offset -= 1 |
257 | ret = old_div(end_offset, bds) | 251 | ret = end_offset // bds |
258 | return ret % CHK_PER_INODE | 252 | return ret % CHK_PER_INODE |
259 | 253 | ||
260 | 254 | ||
@@ -278,7 +272,7 @@ def compute_iblock_size_(depth, offset): | |||
278 | ret = CHK_PER_INODE | 272 | ret = CHK_PER_INODE |
279 | else: | 273 | else: |
280 | bds /= CHK_PER_INODE | 274 | bds /= CHK_PER_INODE |
281 | ret = old_div(mod, bds) | 275 | ret = mod // bds |
282 | if (mod % bds) is not 0: | 276 | if (mod % bds) is not 0: |
283 | ret += 1 | 277 | ret += 1 |
284 | return ret | 278 | return ret |