New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@axolo/file-md5-web

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axolo/file-md5-web

Get file md5 in web

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

file-md5-web

Get file md5 in web browser.

install

npm i @axolo/file-md5-web

api

md5file(file, config = {})

params

paramtypedescription
fileFilefile to hash
configObjectconfig of hash
config.sizeNumberfile chunk size, default to 20MB
config.rawBooleanoutput as raw , false to hex
config.onProgressFunctioncallback total chunks and loaded chunk

return

resolve md5 of file or reject Error as Promise.

usage

import md5file from '@axolo/file-md5-web'

// <input id="file" type="file">
document.getElementById('file').addEventListener('change', async () => {
  const md5 = await md5file(this.files[0])
  console.log(md5)
})

Vue CLI

By default babel-loader ignores all files inside node_modules. You can enable [transpileDependencies] to avoid unexpected untranspiled code from third-party dependencies.

// vue.config.js
module.exports = {
  transpileDependencies: ['@axolo/file-md5-web']
}

CommonJS

ES Modules is not supported in CommonJS. You can use UMD version.

const md5file = require('@axolo/file-md5-web/dist/index.umd.cjs')
md5file(file).then(md5 => console.log(md5)) // file from <input type="file">

Yueming Fang 2024-11-01

Keywords

file md5

FAQs

Package last updated on 04 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts