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

kz-js-utils

v1.1.4

Published

Time-safe comparison of two buffers, strings, or Uint8Arrays to prevent timing attacks.

Readme

kz-js-utils

API Reference

Time-Safe Equal

Time-safe comparison of two buffers, strings, or Uint8Arrays to prevent timing attacks.

import { timeSafeEqual } from 'kz-js-utils/buffer';

const isEqual = timeSafeEqual('string1', 'string2'); // false

Password Hashing

Utility functions to hash and verify passwords securely using scrypt algorithm. This is native to Node.js and works on both server and browser environments.

import { hashPassword, verifyPassword } from 'kz-js-utils/password';

const hashedPassword = await hashPassword('mySecurePassword123!'); // e.g., 'randomSalt:hashedPasswordString'

const isPasswordValid = await verifyPassword(hashedPassword, 'mySecurePassword123!'); // true
const isPasswordInvalid = await verifyPassword(hashedPassword, 'wrongPassword'); // false

ID Generators

Utility functions to generate unique identifiers that are proven to be effective in various scenarios.

import {
  createTaggedUID,
  createUID,
  generateCustomRandomString,
  generateRandomString,
  uuiv4,
  uuiv7
} from 'kz-js-utils/id-generators';

// Generate a UUIDv7
uuiv7(); // e.g., '017f1f3e-8b6c-7e4a-9f3c-2d3e4f5g6h7i'

// Generate a simple UID (CUID)
createUID(); // e.g., 'cxyz1234567890abcdefg'

// Generate a tagged UID (CUID with prefix)
createTaggedUID('user_'); // e.g., 'user_cxyz1234567890abcdefg'

// Generate a random string of default length (16)
generateRandomString(); // e.g., 'a1b2c3d4e56f7g8'

// Generate a custom random string with specified length and alphabet
// Default alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
generateCustomRandomString({
  length: 32,
  alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
}); // e.g., 'h1i2j3k4l5mno6p7q8r9s0tuvwxyzABCD'

Disclaimer

This project is not affiliated with any company or organization. The code is provided as-is, without warranty of any kind. Use at your own risk. The author is not responsible for any damages or privacy violations or issues that may arise from using this code. Any misuse of this code is not the responsibility of the author. By using this code, you agree to these terms.

This is a project for learning on concepts like wrapping a library, encapsulating a common library to reduce boilerplate code, cross platform and framework agnostic package, etc. including telemetry practices.

If you have found intrusive code in this package, it's probably because of how the clients/company requires to implement and track developer usage.