JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://pajhome.org.uk/crypt/md5/2.2/md5-min.js"></script>
<script src="http://pajhome.org.uk/crypt/md5/2.2/sha1-min.js"></script>
<input type="file"/>
<div id="output"></div>
JavaScript
$('input').change(function(e){
var f=e.target.files[0];
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function(theFile) {
return function(e) {
$('#output').append('<div>'+hex_sha1(e.target.result)+'</div>')
};
})(f);
// Read in the image file as a data URL.
reader.readAsBinaryString(f);
});