admin管理员组文章数量:1278859
anyone know how to get file MD5 from Filereader readAsArrayBuffer() ?
my current solution is using CryptoJS
- convert arraybuffer to base64
- decode base64 to binary string.
- use CryptoJS.MD5(p_str).toString(CryptoJS.enc.Hex).toUpperCase();
this method get me correct MD5 but I hope to skip the part decode the base64. the suggestions I found is using readAsBinaryString() which deprecated function.
anyone know how to get file MD5 from Filereader readAsArrayBuffer() ?
my current solution is using CryptoJS
- convert arraybuffer to base64
- decode base64 to binary string.
- use CryptoJS.MD5(p_str).toString(CryptoJS.enc.Hex).toUpperCase();
this method get me correct MD5 but I hope to skip the part decode the base64. the suggestions I found is using readAsBinaryString() which deprecated function.
Share Improve this question asked Feb 25 at 8:43 Charles CandyCharles Candy 275 bronze badges 1- I think you got the best possible way. You could create an ExtJS class, but otherwise you are good – Dinkheller Commented Mar 1 at 11:52
1 Answer
Reset to default 0thanks. someone suggest sparkmd5 which calculate md5 from array buffer which is working.
SparkMD5.ArrayBuffer.hash(e.target.result)
本文标签: javascripthow to get file MD5 from FileReader readAsArrayBuffer()Stack Overflow
版权声明:本文标题:javascript - how to get file MD5 from FileReader readAsArrayBuffer() - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741218457a2360504.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论