diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2009-08-07 21:48:07 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2009-08-07 21:48:07 (GMT) |
commit | 1afe6dad31b7e4b9c7143bd50c00c61d6a93011b (patch) | |
tree | e50ebd36dd825b11de76bd7037f299c4f4ded374 /FuseArchive | |
parent | 86c45571271358d61aa1ab23746e9cd0565cf4cb (diff) | |
download | fusearchive-1afe6dad31b7e4b9c7143bd50c00c61d6a93011b.zip fusearchive-1afe6dad31b7e4b9c7143bd50c00c61d6a93011b.tar.gz fusearchive-1afe6dad31b7e4b9c7143bd50c00c61d6a93011b.tar.bz2 |
Add swapable digest for key generation
Diffstat (limited to 'FuseArchive')
-rw-r--r-- | FuseArchive/Storage/FileSystem.py | 5 | ||||
-rw-r--r-- | FuseArchive/Storage/ZipFile.py | 5 |
2 files changed, 6 insertions, 4 deletions
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 ) |