browser-md5-file文件加密值


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', handlefalse);
 
function handle(e{
  const file e.target.files[0];
  bmf.md5(
    file,
    (errmd5=> {
      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();


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM