JSPM

sha1-from-file

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 180
  • Score
    100M100P100Q78665F
  • License CC-BY-4.0

Generate a short sha1 hash from a file's contents

Package Exports

  • sha1-from-file

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sha1-from-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sha1-from-file

Build Status npm

generate a short sha1 hash from a file's contents

install

npm install sha1-from-file --save

usage

import { createReadStream, readFileSync } from 'fs'
import hash, { sync } from 'sha1-from-file'

// async (ES6-)
hash(createReadStream('./file.txt')).then(myHash => ...)

// async (ES7)
const myHash = await hash(createReadStream('./file.txt'))

// sync (buffer)
const myHash = sync(new Buffer(...))

// sync (string)
const myHash = sync(readFileSync('./file.txt', 'utf-8')) // "1bhh17h"