Socket
Socket
Sign inDemoInstall

sha1-file

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sha1-file

return an sha1sum of a given file


Version published
Weekly downloads
43K
increased by21.65%
Maintainers
1
Install size
3.42 kB
Created
Weekly downloads
 

Readme

Source

sha1-file Build Status js-standard-style

Simply return an sha1 sum of a given file. If using async version (by including callback), it will stream; successfully tested on files 4 GB+.

Installation

$ npm install sha1-file

API

sha1File(path, [callback])

const sha1File = require('sha1-file')

// sync (no callback)

sha1File('./path/to/a_file') // 'c8a2e2125f94492082bc484044edb4dc837f83b'

// async/streamed (if using callback)

sha1File('./path/to/a_file', function (error, sum) {
  if (error) {
    console.log(error)
  }

  console.log(sum) // 'c8a2e2125f94492082bc484044edb4dc837f83b'
})

Keywords

FAQs

Last updated on 02 Jun 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc