From 1afe6dad31b7e4b9c7143bd50c00c61d6a93011b Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Fri, 7 Aug 2009 14:48:07 -0700 Subject: Add swapable digest for key generation diff --git a/FuseArchive/Storage/FileSystem.py b/FuseArchive/Storage/FileSystem.py index b5d5222..4709e1a 100644 --- a/FuseArchive/Storage/FileSystem.py +++ b/FuseArchive/Storage/FileSystem.py @@ -1,4 +1,5 @@ -import FuseArchive, logging, os, sha, sys +import FuseArchive, logging, os, sys +import FuseArchive.Digest from binascii import hexlify from FuseArchive.Chunk import Chunk @@ -59,7 +60,7 @@ def save_chunk( chunk ): logging.debug( "Chunk: %s" + hexlify( chunk ) ) # Save this hash string, similar to the backuppc algo - digest = sha.new( chunk ).digest() + digest = FuseArchive.Digest.compute( chunk ) # Write out our chunk chars = list( digest ) diff --git a/FuseArchive/Storage/ZipFile.py b/FuseArchive/Storage/ZipFile.py index 83898ef..486ee39 100644 --- a/FuseArchive/Storage/ZipFile.py +++ b/FuseArchive/Storage/ZipFile.py @@ -1,4 +1,5 @@ -import os, logging, FuseArchive, zipfile, sha +import os, logging, FuseArchive, zipfile +import FuseArchive.Digest from binascii import hexlify def save_chunk( chunk ): @@ -10,7 +11,7 @@ def save_chunk( chunk ): logging.debug( "Chunk: %s" + hexlify( chunk ) ) # Save this hash string, similar to the backuppc algo - digest = sha.new( chunk ).digest() + digest = FuseArchive.Digest.comput( chunk ) # Write out our chunk chars = list( digest ) -- cgit v0.10.2