Example #1
0
    def __getMd5(self, file):
        """Returns the MD5 sum of the specified file."""

        retVal = "?" * 32

        try:
            retVal = checksum(file, self.__MD5_CHUNK_SIZE)
        except IOError, ioe:
            self.__alert("ERROR: Unable to open %s for reading.  Error: %s" % (file,ioe))
Example #2
0
 def test_simple_hash(self):
     self.assertEquals(checksum(StringIO('this is a test'), algorithm="sha256"),
             '2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c')
Example #3
0
 def test_simple_hash(self):
     self.assertEquals(
         checksum(StringIO('this is a test'), algorithm="sha256"),
         '2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c')