Socket
Socket
Sign inDemoInstall

sha

Package Overview
Dependencies
1
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sha

Check and get file hashes


Version published
Maintainers
1
Install size
23.2 kB
Created

Readme

Source

sha

Check and get file hashes (using any algorithm)

Build Status Dependency Status

Installation

$ npm install sha

API

check(fileName, expected, [options,] cb)

Asynchronously check that fileName has a "hash" of expected. The callback will be called with either null or an error (indicating that they did not match).

Options:

  • algorithm: defaults to sha1 and can be any of the algorithms supported by crypto.createHash

get(fileName, [options,] cb)

Asynchronously get the "hash" of fileName. The callback will be called with an optional error object and the (lower cased) hex digest of the hash.

Options:

  • algorithm: defaults to sha1 and can be any of the algorithms supported by crypto.createHash

License

BSD

FAQs

Last updated on 28 Apr 2013

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