Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace SHA-512 hashing function with the ~10 times faster BLAKE3. #2530

Open
wants to merge 13 commits into
base: py3
Choose a base branch
from
Prev Previous commit
Next Next commit
Update SiteStorage.py
  • Loading branch information
GoodByeZeroNet committed Apr 13, 2020
commit 8c56275511243be84dc2061cc9d73a29d31174fa
4 changes: 2 additions & 2 deletions src/Site/SiteStorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def getInnerPath(self, path):
raise Exception("File not allowed: %s" % path)
return inner_path

# Verify all files sha512sum using content.json
# Verify all files b3sum using content.json
def verifyFiles(self, quick_check=False, add_optional=False, add_changed=True):
bad_files = []
back = defaultdict(int)
Expand Down Expand Up @@ -477,7 +477,7 @@ def verifyFiles(self, quick_check=False, add_optional=False, add_changed=True):
file_inner_path = helper.getDirname(content_inner_path) + file_relative_path # Relative to site dir
file_inner_path = file_inner_path.strip("/") # Strip leading /
file_path = self.getPath(file_inner_path)
hash_id = self.site.content_manager.hashfield.getHashId(file_node["sha512"])
hash_id = self.site.content_manager.hashfield.getHashId(file_node["blake3"])
if not os.path.isfile(file_path):
if self.site.content_manager.isDownloaded(file_inner_path, hash_id):
back["num_optional_removed"] += 1
Expand Down