All Projects → forsigner → Browser Md5 File

forsigner / Browser Md5 File

Licence: mit
MD5 file in browser.

Labels

browser-md5-file NPM Version

MD5 file in browser. Base on js-spark-md5.

Demo

demo

Installation

$ npm i browser-md5-file -S

Usage

import BMF from 'browser-md5-file';

const el = document.getElementById('upload');
const bmf = new BMF();

el.addEventListener('change', handle, false);

function handle(e) {
  const file = e.target.files[0];
  bmf.md5(
    file,
    (err, md5) => {
      console.log('err:', err);
      console.log('md5 string:', md5); // 97027eb624f85892c69c4bcec8ab0f11
    },
    progress => {
      console.log('progress number:', progress);
    },
  );
}

You can abort it before success to md5 :

  bmf.abort();

Browser compatibility

  • IE9+
  • Firefox
  • Chrome
  • Safari
  • Opera

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].