Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting the same md5 regardless of Blob contents #23

Closed
silverbucket opened this issue May 20, 2015 · 1 comment
Closed

Getting the same md5 regardless of Blob contents #23

silverbucket opened this issue May 20, 2015 · 1 comment

Comments

@silverbucket
Copy link

Not sure what I'm doing wrong here, following the documentation I do something like this:

var img = document.getElementById('image');
var imgBlob = base64ToBlob(getBase64Image(img));

var spark = new SparkMD5.ArrayBuffer();
spark.append(imgBlob);
console.log('md5: ' + spark.end());

No matter which image I use as the test, I always get the md5:
d0ad09ba8fe3801ac437d06ba62740d2

From the filesystem, I get the md5:

$ md5 test_image.png 
MD5 (test_image.png) = d1a87269a70cb65ed4a41d272d376052

I've also tried with:

SparkMD5.ArrayBuffer.hash(imgBlob, false);
"d41d8cd98f00b204e9800998ecf8427e"

Which always returns that md5 no matter which test image I use.

The same happens when I use a more complicated example with transferred files (non-images), I get the same md5 sum that I get here with the images.

Any idea what I'm doing wrong here?

@silverbucket
Copy link
Author

Nevermind, this was a user error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant