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.95 kB
Created
Weekly downloads
 

Readme

Source

sha1-file Build Status

Simply return an sha1 sum of a given file.

Installation

$ npm install sha1-file

Test:

$ npm test

API

Sync:

sha1File(path)

var sha1File = require('sha1-file');

sha1File('path/to/a_file'); // '18e904aae79b5642ed7975c0a0074936'

Async:

sha1File(path, callback, [strict])

If strict is true and there is an error it will throw it, otherwise it will pass an error string through the callback.

sha1File.async('./README.md', function (data) {
  console.log(data);
});

sha1File.async('./README.md', function (data) {
  console.log(data);
}, true);

// errors

// non-strict: will pass through an error to `data`
sha1File.async('./null', function (data) {
  console.log(data);
});

// strict: will throw an error
sha1File.async('./null', function (data) {
  console.log(data);
}, true);

License

MIT

Keywords

FAQs

Last updated on 07 Dec 2014

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