0.0.3 • Published 4 years ago

js-file-md5 v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

js-file-md5

Get a MD5 hash from a file with Javascript.

Usage

HTML

<input id="example-file" type="file" />

Javascript

import md5 from 'js-file-md5';

const fileInput = document.querySelector('#example-file');

fileInput.addEventListener('change', function(e) {
  const file = e.target.files[0];

  md5(file).then(hash => {
    console.log(hash); // md5 hash
    console.log(btoa(hash)); // base64 encode
  }).catch(error => {
    throw error;
  });
});
0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago