Returns the md5-sum of this file. This is of course potentially
        expensive!
10922
def md5(self):
        
        hash_ = hashlib.md5()
        with self.open("rb") as inf:
            block = inf.read(4096)
            while block:
                hash_.update(block)
                block = inf.read(4096)

        return hash_.hexdigest()
1030498
def md5_checksum(file_path, chunk_bytes=4194304):
    """"""

    with open(file_path, "rb") as infile:
        checksum = hashlib.md5()
        while 1:
            data = infile.read(chunk_bytes)
            if not data:
                break
            checksum.update(data)

    return checksum.hexdigest()
464770
def calculate_md5(fileobject, size=2**16):
    """"""
    fileobject.seek(0)
    md5 = hashlib.md5()
    for data in iter(lambda: fileobject.read(size), b''):
        if not data: break
        if isinstance(data, six.text_type):
            data = data.encode('utf-8') # md5 needs a byte string
        md5.update(data)
    fileobject.seek(0) # rewind read head
    return md5.hexdigest()
750185
def _md5(path, blocksize=2 ** 20):
    """"""
    m = hashlib.md5()
    with open(path, 'rb') as f:
        while True:
            buf = f.read(blocksize)
            if not buf:
                break
            m.update(buf)
    return m.hexdigest()
411059
def _md5_compute(self, f):
        '''
        
        '''
        md5 = hashlib.md5()
        block_size = 16384
        f.seek(0, 2)
        remaining = f.tell()
        f.seek(0)

        while (remaining > block_size):
            data = f.read(block_size)
            remaining = remaining - block_size
            md5.update(data)

        if remaining > 0:
            data = f.read(remaining)
            md5.update(data)

        return md5.digest()
1042778
def md5sum(file_path, blocksize=65536):
    """"""
    md5 = hashlib.md5()
    with open(file_path, "rb") as f:
        for block in iter(lambda: f.read(blocksize), ""):
            md5.update(block)
    return md5.hexdigest()
869770
def _select_md5sum_arch(self, md5sum, md5sum64):
        
        if md5sum and md5sum64:
            if self.meta.arch == "x86_64":
                return md5sum64
            else:
                return md5sum
        if md5sum:
            return md5sum
        else:
            return md5sum64
1063285
def md5sum( string ):
    
    h = hashlib.new( 'md5' )
    h.update( string.encode( 'utf-8' ) )
    return h.hexdigest()
559651
def md5sum(path):
    

    if path is None or len(path) == 0 or not os.path.exists(path):
        return None

    try:
        with open(path + '.md5sum') as f:
            md5 = f.read()
            if len(md5) == 32:
                return md5
    # Unicode error is when user rename an image to .md5sum ....
    except (OSError, UnicodeDecodeError):
        pass

    try:
        m = hashlib.md5()
        with open(path, 'rb') as f:
            while True:
                buf = f.read(128)
                if not buf:
                    break
                m.update(buf)
        digest = m.hexdigest()
    except OSError as e:
        log.error("Can't create digest of %s: %s", path, str(e))
        return None

    try:
        with open('{}.md5sum'.format(path), 'w+') as f:
            f.write(digest)
    except OSError as e:
        log.error("Can't write digest of %s: %s", path, str(e))

    return digest
305913
def get_blob_hash(self, h=hashlib.md5):
        
        assert callable(h)
        return h(self.get_blob_data())
1203675
def md5sum(data):
    
    if six.PY3:  # pragma: no cover
        return hashlib.md5(data.encode('utf-8')).hexdigest()
    else:  # pragma: no cover
        return hashlib.md5(data).hexdigest()
675313
def get_checksum(self):
        """"""
        with open(self.file, 'rb') as f:
            cs = md5(f.read()).hexdigest()
        return cs
592231
def get_md5sum(src_file):
    """"""
    with open(src_file, 'rb') as src_data:
        src_content = src_data.read()
        return hashlib.md5(src_content).hexdigest()
293838
def get_multipart_md5(self, filename, chunk_size=8 * 1024 * 1024):
        
        # Loop through the file contents ...
        md5s = []
        with open(filename, 'rb') as fp:
            while True:
                # Break it into chunks
                data = fp.read(chunk_size)
                # Finish when there are no more
                if not data:
                    break
                # Generate a md5 hash for each chunk
                md5s.append(hashlib.md5(data))

        # Combine the chunks
        digests = b"".join(m.digest() for m in md5s)

        # Generate a new hash using them
        new_md5 = hashlib.md5(digests)

        # Create the ETag as Amazon will
        new_etag = '"%s-%s"' % (new_md5.hexdigest(), len(md5s))

        # Trim it down and pass it back for comparison
        return new_etag.strip('"').strip("'")
1068747
def md5(self):
        """"""
        return hashlib.md5('_'.join([self.CHROM, str(self.POS), self.REF,
                                     self.ALT])).hexdigest()
1175932
def get_md5_hash(file_path):
    
    checksum = hashlib.md5()
    with open(file_path, 'rb') as f:
        for chunk in iter(lambda: f.read(128 * checksum.block_size), b''):
            checksum.update(chunk)
    return checksum.hexdigest()
768809
@Override
	public int read() throws IOException {
		int c = in.read();
		if (c == -1) return -1;

		md5.Update(c);

		return c;
	}