Proper way to read a file using FileReader() to generate an md5 hash string from image files?
问题 I'm currently doing this (see snippet below) to get an md5 hash string for the image files I'm uploading (I'm using the hash as fileNames ): NOTE: I'm using the md5 package to generate the hash (it's loaded into the snippet). There are 4 available methods on FileReader() to read the files. They all seem to produce good results. readAsText(file) readAsBinaryString(file); readAsArrayBuffer(file); readAsDataURL(file); Which is should I be using in this case and why? Can you also explain the