Skip to content

Releases: timtjoe/localuid

v1.0.2

21 Jan 19:48

Choose a tag to compare

New version of localuid is live! See the changes below.

Full Changelog: v1.0.0...v1.0.2

v1.0.0: Secure URL-Friendly Identifiers

21 Jan 17:32

Choose a tag to compare

🚀 v1.0.0: Initial Release of localuid
A high-performance, cryptographically secure utility for generating clean, URL-friendly identifiers.

Key Features

  • Cryptographically Secure (CSPRNG): Built using globalThis.crypto to ensure non-deterministic, collision-resistant randomness.
  • Beautiful Numbers: Numeric generation strictly avoids leading zeros. This ensures IDs remain valid mathematical representations and prevents data truncation when converting strings to integers (e.g., for BigInt usage).
  • URL-Safe by Design: Generates identifiers using only safe characters [a-z, A-Z, 0-9], ideal for slugs like /1234kshdi.
  • Optimized for Bun & TypeScript: Native support for the Bun runtime with 100% type coverage and strict validation.
  • Custom Charsets: Includes a .custom() method to generate IDs for specific use cases (e.g., meeting codes that exclude ambiguous characters like 0, O, I, l).

Security & Validation Length Guard:

  • Length Guard: Strictly enforces length constraints (6-13 characters) to protect against memory exploits and maintain entropy standards.
  • Input Sanitization: Every method verifies user input to ensure stable and predictable output.

Mathematical Reliability:
By using a character set of 62 (alphanumeric) and a length of 13, your pool of unique IDs is approximately $3 \times 10^{23}$. This provides a massive safety margin against collisions.

📦 Installation

bun add localuid