Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

file-to-sha384

0.0.1 • Public • Published

file-to-sha384

Calculates a SHA-384 of a given file

Install

Using yarn:

yarn add file-to-sha384

or using npm:

npm install file-to-sha384

Usage in the browser

import { blobToSHA384 } from 'file-to-sha384'
 
const hash = await blobToSHA384(fileInput.files[0])

Usage in node

For file paths

const { pathToSHA384 } = require('file-to-sha384')
 
const hash = await pathToSHA384('/path/to/file')

For buffers or strings

const fs = require('fs')
const { dataToSHA384 } = require('file-to-sha384')
 
const buffer = fs.readFileSync('/path/to/file')
 
const hash = dataToSHA384(buffer)

Install

npm i file-to-sha384

DownloadsWeekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

2.99 kB

Total Files

6

Last publish

Collaborators

  • avatar