Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
A lightweight and secure npm package providing a SHA-256 hashing algorithm implementation in pure JavaScript. Use this package to easily hash sensitive data for various applications, ensuring data integrity and security.
A lightweight and secure npm package providing a SHA-256 hashing algorithm implementation in pure JavaScript. Use this package to easily hash sensitive data for various applications, ensuring data integrity and security.
You can install crypash
using npm:
npm install crypash
// Import the crypash module
const crypash = require('crypash');
const inputText = "Hello, World!";
const algorithmToUse = 'sha256';
const hashedValue = crypash.hash(algorithmToUse, inputText);
if (crypash.check(algorithmToUse, inputText, hashedValue)) {
console.log("Text matches the hashed value.");
} else {
console.log("Text does not match the hashed value.");
}
hash(algorithm: Algorithm, input: string): string
This function hashes the input data using the specified algorithm.
algorithm
(string): The hashing algorithm to use. Currently, only 'sha256'
is supported.input
(string): The data to be hashed.Returns the hashed value as a hexadecimal string.
check(algorithm: Algorithm, input: string, hashedString: string): boolean
This function checks if a given text, when hashed, matches a provided hashed value.
algorithm
(string): The hashing algorithm to use. Currently, only 'sha256'
is supported.input
(string): The original text.hashedString
(string): The hashed value to compare against.Returns true
if the text matches the hashed value, and false
otherwise.
// Import the crypash module
const crypash = require('crypash');
const inputText = "Example Data";
const algorithmToUse = 'sha256';
const hashedValue = crypash.hash(algorithmToUse, inputText);
if (crypash.check(algorithmToUse, inputText, hashedValue)) {
console.log("Text matches the hashed value.");
} else {
console.log("Text does not match the hashed value.");
}
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A lightweight and secure npm package providing a SHA-256 hashing algorithm implementation in pure JavaScript. Use this package to easily hash sensitive data for various applications, ensuring data integrity and security.
We found that crypash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.