npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

noctahash

v0.1.0

Published

Memory-hard password hashing algorithm for Node.js and browsers

Readme

noctahash

Memory-hard password hashing algorithm for Node.js and browsers (WebAssembly).

Installation

npm install noctahash

Usage

Node.js

const { hash, verify_password, generate_salt } = require('noctahash');

// Generate hash with automatic salt
const hashString = hash('password', null, 3, 64, 1, 'base64');
console.log(hashString);

// Verify password
const isValid = verify_password('password', hashString);
console.log(isValid);

// Custom salt
const salt = generate_salt(32);
const hashWithSalt = hash('password', salt, 3, 64, 1, 'base64');

Browser

<script type="module">
  import init, { hash, verify_password } from './pkg-web/noctahash.js';
  
  await init();
  
  const hashString = hash('password', null, 3, 64, 1, 'base64');
  const isValid = verify_password('password', hashString);
</script>

ES Modules

import init, { hash, verify_password, generate_salt } from 'noctahash';

await init();

const hashString = hash('password', null, 3, 64, 1, 'base64');
const isValid = verify_password('password', hashString);

API

hash(password, salt, time_cost, memory_cost_mb, parallelism, encoding)

Creates a password hash.

  • password (string): Password to hash
  • salt (Uint8Array | null): Optional salt (32 bytes recommended)
  • time_cost (number): Number of iterations (1-16777216)
  • memory_cost_mb (number): Memory usage in MB (≥1)
  • parallelism (number): Number of lanes (1-255, limited to 1 in WASM)
  • encoding (string): "base64" or "hex"

Returns: string - Formatted hash string

verify_password(password, hash_string)

Verifies a password against a hash.

  • password (string): Password to verify
  • hash_string (string): Hash string to verify against

Returns: boolean - True if password matches

generate_salt(length?)

Generates a random salt.

  • length (number, optional): Salt length in bytes (default: 32)

Returns: Uint8Array - Random salt bytes

get_version()

Returns the algorithm version number.

Returns: number

Parameters

  • time_cost: 1-16777216 (recommended: 2-3)
  • memory_cost_mb: ≥1 (recommended: 32-64)
  • parallelism: 1-255 (limited to 1 in WASM/browser)
  • encoding: "base64" or "hex"

Building from Source

npm install
npm run build

For web:

npm run build-web

For bundlers (webpack, rollup, etc.):

npm run build-bundler

License

MIT

Author

Tuna4L - GitHub