Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Jun 2, 2024 via pnpm

hasha 1.0.0

Get the hash of a buffer/string/stream/file
Package summary
Share
4
issues
2
high severity
vulnerability
1
license
1
2
low severity
license
2
6
licenses
40
MIT
4
ISC
2
Apache-2.0
3
other licenses
BSD-2-Clause
1
CC-BY-3.0
1
CC0-1.0
1
Package created
23 May 2015
Version published
23 May 2015
Maintainers
1
Total deps
49
Direct deps
2
License
MIT

Issues

4

2 high severity issues

high
Recommendation: Upgrade to version 3.0.1 or later
via: meow@3.7.0
Recommendation: Read and validate the license terms
via: meow@3.7.0
Collapse
Expand

2 low severity issues

low
Recommendation: Read and validate the license terms
via: meow@3.7.0
Recommendation: Read and validate the license terms
via: meow@3.7.0
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
40 Packages, Including:
array-find-index@1.0.2
camelcase-keys@2.1.0
camelcase@2.1.1
currently-unhandled@0.4.1
decamelize@1.2.0
error-ex@1.3.2
find-up@1.1.2
function-bind@1.1.2
get-stdin@4.0.1
hasha@1.0.0
hasown@2.0.2
indent-string@2.1.0
is-arrayish@0.2.1
is-core-module@2.13.1
is-finite@1.1.0
is-stream@1.1.0
is-utf8@0.2.1
load-json-file@1.1.0
loud-rejection@1.6.0
map-obj@1.0.1
meow@3.7.0
minimist@1.2.8
object-assign@4.1.1
parse-json@2.2.0
path-exists@2.1.0
path-parse@1.0.7
path-type@1.1.0
pify@2.3.0
pinkie-promise@2.0.1
pinkie@2.0.4
read-pkg-up@1.0.1
read-pkg@1.1.0
redent@1.0.0
repeating@2.0.1
resolve@1.22.8
spdx-expression-parse@3.0.1
strip-bom@2.0.0
strip-indent@1.0.1
supports-preserve-symlinks-flag@1.0.0
trim-newlines@1.0.0

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
graceful-fs@4.2.11
hosted-git-info@2.8.9
semver@5.7.2
signal-exit@3.0.7

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
2 Packages, Including:
spdx-correct@3.2.0
validate-npm-package-license@3.0.4

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
normalize-package-data@2.5.0

Creative Commons Attribution 3.0 Unported

Uncategorized
Not OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
Cannot
Must
1 Packages, Including:
spdx-exceptions@2.5.0

Creative Commons Zero v1.0 Universal

Public Domain
Not OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
Cannot
Must
1 Packages, Including:
spdx-license-ids@3.0.18
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of hasha 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
is-stream1.1.01.58 kBMIT
prod
meow3.7.03.53 kBMIT
prod
2
2

Visualizations

Frequently Asked Questions

What does hasha do?

Hasha is a convenient, user-friendly wrapper for the core 'crypto' Hash class in Node.js, offering a simpler API and superior default settings for hashing processes. Perfect for generating cryptographic hash values from a buffer, string, stream, or file, Hasha utilises best-practice defaults in its operations.

How do you use hasha?

Hasha is versatile, easy to use and can be installed using npm:

$ npm install hasha

Once installed, you can use Hasha to hash a string or a buffer like so:

const hasha = require('hasha');

hasha('unicorn');
//=> 'e233b19aabc7d5e53826fb734d1222f1f0444c3a3fc67ff4af370a66e7cadd2cb24009f1bc86f0bed12ca5fcb226145ad10fc5f650f6ef0959f8aadc5a594b27'

For asynchronous operations, use hasha.async:

const hasha = require('hasha');

(async () => {
	console.log(await hasha.async('unicorn'));
	//=> 'e233b19aabc7d5e53826fb734d1222f1f0444c3a3fc67ff4af370a66e7cadd2cb24009f1bc86f0bed12ca5fcb226145ad10fc5f650f6ef0959f8aadc5a594b27'
})();

To hash a file, you can use hasha.fromFile:

const hasha = require('hasha');
(async () => {
	// Get the MD5 hash of an image
	const hash = await hasha.fromFile('unicorn.png', {algorithm: 'md5'});
	console.log(hash);
	//=> '1abcb33beeb811dca15f0ac3e47b88d9'
})();

Where are the hasha docs?

The most comprehensive documentation for Hasha can be found on the Node.js crypto API documentation page: https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options. Here you'll find details about hashing and the options you can use in Hasha's methods. You can also refer to the GitHub repository here for additional details.