Gathering detailed insights and metrics for js-sha1
Gathering detailed insights and metrics for js-sha1
Gathering detailed insights and metrics for js-sha1
Gathering detailed insights and metrics for js-sha1
A simple SHA1 hash function for JavaScript supports UTF-8 encoding.
npm install js-sha1
Typescript
Module System
Node Version
NPM Version
JavaScript (95.49%)
HTML (4.51%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
22,301,719
Last Day
2,888
Last Week
2,888
Last Month
595,897
Last Year
7,781,577
339 Stars
20 Commits
150 Forks
16 Watching
2 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.7.0
Package Id
js-sha1@0.7.0
Unpacked Size
32.76 kB
Size
8.97 kB
File Count
7
NPM Version
6.14.13
Node Version
14.17.1
Publised On
24 Jan 2024
Cumulative downloads
Total Downloads
Last day
0%
2,888
Compared to previous day
Last week
-97.8%
2,888
Compared to previous week
Last month
-0.4%
595,897
Compared to previous month
Last year
39.7%
7,781,577
Compared to previous year
A simple SHA1 hash function for JavaScript supports UTF-8 encoding.
SHA1 Online SHA1 File Checksum Online
You can also install js-sha1 by using Bower.
bower install js-sha1
For node.js, you can use this command to install:
npm install js-sha1
NIST formally deprecated use of SHA-1 in 2011 and disallowed its use for digital signatures in 2013, and declared that it should be phased out by 2030. However, SHA-1 is still secure for HMAC. wiki
You could use like this:
1sha1('Message to hash'); 2var hash = sha1.create(); 3hash.update('Message to hash'); 4hash.hex(); 5 6// HMAC 7sha1.hmac('key', 'Message to hash'); 8 9var hash = sha1.hmac.create('key'); 10hash.update('Message to hash'); 11hash.hex();
If you use node.js, you should require the module first:
1var sha1 = require('js-sha1');
If you use TypeScript, you can import like this:
1import { sha1 } from 'js-sha1';
It supports AMD:
1require(['your/path/sha1.js'], function(sha1) { 2// ... 3});
1sha1(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709 2sha1('The quick brown fox jumps over the lazy dog'); // 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 3sha1('The quick brown fox jumps over the lazy dog.'); // 408d94384216f890ff7a0c3528e8bed1e0b01621 4 5// It also supports UTF-8 encoding 6sha1('中文'); // 7be2d2d20c106eee0836c9bc2b939890a78e8fb3 7 8// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` 9sha1([]); // da39a3ee5e6b4b0d3255bfef95601890afd80709 10sha1(new Uint8Array([])); // da39a3ee5e6b4b0d3255bfef95601890afd80709 11 12// Different output 13sha1(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709 14sha1.hex(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709 15sha1.array(''); // [218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9] 16sha1.digest(''); // [218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9] 17sha1.arrayBuffer(''); // ArrayBuffer 18 19// HMAC 20sha1.hmac.hex('key', 'Message to hash'); 21sha1.hmac.array('key', 'Message to hash'); 22// ...
The project is released under the MIT license.
The project's website is located at https://github.com/emn178/js-sha1
Author: Chen, Yi-Cyuan (emn178@gmail.com)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More