What the md5_10m and how to calculate md5_10m using python?

53 views Asked by At

i use this code to calculate md5 for file to use it in request to upload file

params name vgroup

but javascript generating different md5 than python when file > 10MB

my code:

import hashlib , os

def file_hash(file_path : str):

    '''
    retrun hash_filesize

    example:
        `835e7e4510fb9614d6d2d43ba1de1dc7_2544962`
       
    '''

    st = os.stat(file_path)
    file_size  = st.st_size

    
    md5Hash = hashlib.md5(open(file_path , 'rb' ).read()) .hexdigest()
    return f'{md5Hash}_{file_size}'


javascript code:

part from javascriot code

full js code here:

https://www.moneycase.io/public/js/chunk/pc/campaigns/file-manager.8908aa3a.js

0

There are 0 answers