How to get the MD5 hex hash for a file using VBA?

Posted by aF on Stack Overflow See other posts from Stack Overflow or by aF
Published on 2010-05-13T11:19:46Z Indexed on 2010/05/19 1:00 UTC
Read the original article Hit count: 220

Filed under:
|
|
|
|

How can I get the MD5 hex hash for a file using VBA?

I need a version that works for a file.

Something as simple as this Python code:

import hashlib

def md5_for_file(fileLocation, block_size=2**20):
    f = open(fileLocation)
    md5 = hashlib.md5()
    while True:
        data = f.read(block_size)
        if not data:
            break
        md5.update(data)
    f.close()
    return md5.hexdigest()

But in VBA.

© Stack Overflow or respective owner

Related posts about vba

Related posts about powerpoint-vba