首页 > 解决方案 > azure Blob MD5 checksum and local MD5 checksum not matching

问题描述

my file test.txt contains

checksum test file

when I upload into blob its md5 is

CONTENT-MD5 cvL65GNcvWFoqZUTI5oscw==

when I run in local md5Sum test.txt its value is

72f2fae4635cbd6168a99513239a2c73

标签: azureblobazure-blob-storagemd5sum

解决方案


As discussed in the comments. Solution from here:

Googled around and found a suggestion to use openssl dgst, and it worked!

openssl dgst -md5 -binary $filename | base64

Turns out, md5sum returns a hex representation of the hash and I had to unhex it before computing its base64:

md5sum --binary $filename | awk '{print $1}' | xxd -p -r | base64


推荐阅读