
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
Abstract base class to inherit from if you want to create streams implementing the same API as node crypto Hash (for Cipher / Decipher check crypto-browserify/cipher-base).
const HashBase = require('hash-base');
const inherits = require('inherits');
// our hash function is XOR sum of all bytes
function MyHash () {
HashBase.call(this, 1); // in bytes
this._sum = 0x00;
};
inherits(MyHash, HashBase)
MyHash.prototype._update = function () {
for (let i = 0; i < this._block.length; ++i) {
this._sum ^= this._block[i];
}
};
MyHash.prototype._digest = function () {
return this._sum;
};
const data = Buffer.from([0x00, 0x42, 0x01]);
const hash = new MyHash().update(data).digest();
console.log(hash); // => 67
You also can check source code or crypto-browserify/md5.js
MIT
The 'crypto' module is a built-in Node.js module that provides cryptographic functionality. It includes a wide range of cryptographic functions, including hash, HMAC, cipher, decipher, sign, and verify functions. Unlike hash-base, which is designed for creating custom hash functions, 'crypto' provides ready-to-use implementations of various cryptographic algorithms.
The 'sha.js' package is a simple module for hashing messages with SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512. It is similar to hash-base in that it focuses on hashing functionalities but differs by providing specific implementations of SHA algorithms rather than a base framework for creating custom hash functions.
The 'md5.js' package is a JavaScript function for hashing messages with MD5. It is designed for simplicity and ease of use for MD5 hashing specifically. While hash-base provides a base for creating various hash functions, 'md5.js' is focused solely on MD5 hashing, making it less flexible but easier to use for MD5-specific applications.
FAQs
abstract base class for hash-streams
The npm package hash-base receives a total of 16,421,022 weekly downloads. As such, hash-base popularity was classified as popular.
We found that hash-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.