From 66cc6d8ab709f2c0418776a11b260f3f5b2076d6 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Thu, 13 Jun 2019 15:24:26 +0100 Subject: [PATCH] reduce piece size by factor of 8 --- .../src/main/groovy/com/muwire/core/files/FileHasher.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy b/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy index 51a2d704..4dee2fe2 100644 --- a/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy +++ b/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy @@ -20,12 +20,12 @@ class FileHasher { * @return the size of each piece in power of 2 */ static int getPieceSize(long size) { - if (size <= 0x1 << 27) + if (size <= 0x1 << 30) return 17 - for (int i = 28; i <= 37; i++) { + for (int i = 31; i <= 37; i++) { if (size <= 0x1L << i) { - return i-10 + return i-13 } }