コード例 #1
0
    def test_hashFile(self):
        cwd = os.path.dirname(os.path.realpath(__file__))
        imPath = os.path.join(cwd, 'testimages', 'lolcat-oregon-trail.jpg')

        with open(imPath, "rb") as fp:
            fCont = fp.read()

        hexHash = hashFile.getMd5Hash(fCont)

        self.assertEqual(hexHash, "7227289a017988b6bdcf61fd4761f6b9")
コード例 #2
0
	def test_hashFile(self):
		cwd = os.path.dirname(os.path.realpath(__file__))
		imPath = os.path.join(cwd, 'testimages', 'lolcat-oregon-trail.jpg')

		with open(imPath, "rb") as fp:
			fCont = fp.read()


		hexHash = hashFile.getMd5Hash(fCont)

		self.assertEqual(hexHash, "7227289a017988b6bdcf61fd4761f6b9")
コード例 #3
0
    def getFileMd5(self, wholePath):

        with open(wholePath, "rb") as fp:
            fCont = fp.read()
        hexHash = hasher.getMd5Hash(fCont)
        return hexHash, fCont
コード例 #4
0
	def getFileMd5(self, wholePath):

		with open(wholePath, "rb") as fp:
			fCont = fp.read()
		hexHash = hasher.getMd5Hash(fCont)
		return hexHash, fCont