Gathering detailed insights and metrics for hash-detectjs
Gathering detailed insights and metrics for hash-detectjs
npm install hash-detectjs
Typescript
Module System
Node Version
NPM Version
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
782
Last Day
6
Last Week
10
Last Month
26
Last Year
131
Minified
Minified + Gzipped
Latest Version
1.0.5
Package Id
hash-detectjs@1.0.5
Unpacked Size
14.03 kB
Size
4.88 kB
File Count
8
NPM Version
9.2.0
Node Version
14.18.0
Cumulative downloads
Total Downloads
Last day
0%
6
Compared to previous day
Last week
42.9%
10
Compared to previous week
Last month
420%
26
Compared to previous month
Last year
-32.8%
131
Compared to previous year
No dependencies detected.
detect-hash is a JavaScript module that allows you to detect the algorithm used to produce a hash. It works by matching the hash against a list of regular expressions and hash algorithms, and returns a list of possible algorithms that the hash could have been produced with. This can be useful for security and forensic applications.
To install this module, run the following command:
npm install hash-detectjs
To use this module in your JavaScript code, you can import it using the require
function:
import {detectHash} from 'hash-detectjs';
// Use the detectHash function to detect the algorithm used to produce a hash
const algorithm = detectHash('<hash>');
Here are some examples of how to use the detectHash
function:
// Import the detectHash function
import {detectHash} from 'hash-detectjs';
// Use the detectHash function to detect the algorithm used to produce a hash
const algorithm = detectHash('<hash>');
console.log(algorithm); // Output: [<algorithm1>, <algorithm2>, ...]
// Use the detectHash function with a custom list of regular expressions and hash algorithms
const regexHashMap = {
"<regex1>": "<algorithm1>",
"<regex2>": "<algorithm2>",
...
};
const algorithm = detectHash('<hash>', regexHashMap);
console.log(algorithm); // Output: [<algorithm1>, <algorithm2>, ...]
By default, the detectHash
function uses a built-in list of regular expressions and hash algorithms to detect the algorithm used to produce a hash. You can customize this behavior by providing a custom list of regular expressions and hash algorithms in the form of a JSON object. For example:
import {detectHash} from 'hash-detectjs';
// Customize the list of regular expressions and hash algorithms
const regexHashMap = {
"<regex1>": "<algorithm1>",
"<regex2>": "<algorithm2>",
...
};
// Use the detectHash function with the custom list of regular expressions and hash algorithms
const algorithm = detectHash('<hash>', regexHashMap);
Cryptographic hash functions : MD5, SHA-1, SHA-256, SHA-512, Whirlpool, Tiger, Haval-192, Haval-256, Streebog-256, Streebog-512
Binary-to-text encoding scheme : Base64
Checksum algorithms : CRC-13, CRC-16, CRC-24, CRC-16-CCITT, Adler-32, Internet Checksum, sum8, sum24, sum32, fletcher-4, fletcher-8, fletcher-16, fletcher-32
Russian cryptographic hash functions: : GOST, HAS-160, Snefru-256
Checksum algorithms for BSD and SYSV systems : BSD checksum, SYSV checksum
Hash functions for hash tables : Pearson hashing, Paul Hsieh's SuperFastHash, Buzhash variable, FNV Hash, MurmurHash, Jenkins Hash
Cryptographic hash functions based on the RACE Integrity Primitives Evaluation Message Digest (RIPEMD) algorithm : RIPEMD-128, RIPEMD-160, RIPEMD-224, RIPEMD-256, RIPEMD-320:
We welcome contributions to this project. If you have found a bug or have a feature request, please open a new issue and provide as much information as possible.
If you would like to contribute code to the project, please follow these steps:
Add support for more hash algorithms: The module currently only supports a limited number of hash algorithms, and adding support for more algorithms could make it more useful for a wider range of applications.
:Optimize the performance of the module:: The module currently uses a brute-force approach to matching hashes against regular expressions, which may not be efficient for large datasets. Optimizing the performance of the module, such as by using faster algorithms or parallel processing, could make it more practical for use with large datasets.
This project is licensed under the MIT License - see the LICENSE file for details.
No vulnerabilities found.
No security vulnerabilities found.