
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
A function which will always return the same output given the same
input. The output is an integer in the range 0..n. By default n is
infinity-1, but another max value can be provided as an optional 2nd
argument.
The output is not guaranteed to be unique - only to be predictable based on the input.
npm install hash-index
var hasher = require('hash-index')
// same input => same output
hasher('bob') // => 79268366047899
hasher('alice') // => 90345298322240
hasher('bob') // => 79268366047899
hasher('alice') // => 90345298322240
Using the optional 2nd argument, you can supply an upper limit for the returned hash value:
hasher('bob', 100) // => 99
hasher('alice', 100) // => 40
hasher('bob', 100) // => 99
hasher('alice', 100) // => 40
If no max value is given, infinity-1 is used as the max value.
If max is less than 1 then NaN will be returned.
The input have to be either a non-empty string, a number or a non-empty
array. If not, NaN will be returned.
MIT
FAQs
A hashing function which returns integers with a possible max value
We found that hash-index 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.