skillfed

fastnanoid

A tiny, secure URL-friendly, and fast unique string ID generator for Python, written in Rust.

fastnanoid v0.4.3 155.6K downloads/30d#10,808 on PyPI79
Permissive license AGING released

What it is and what it does

fastnanoid is a Python library that generates short, unique, URL-safe string identifiers. It wraps a Rust implementation to provide performance gains over the original py-nanoid library. The package works as a drop-in replacement for py-nanoid's generate() function, requiring only a one-line import change.

The library also includes helper functions to convert between UUIDs and base64url-encoded strings, useful when you already have a UUID (from a database, for example) and want to display it as a compact string. It supports Python 3.8 through 3.13 and is available as pre-compiled wheels for most common platforms, though installation does require matching the correct wheel for your Python version and architecture.

Use it for:

  • Generate short, unique IDs for database records or API resources as an alternative to sequential or UUID-based identifiers.
  • Create URL-safe tokens for session management, API keys, or temporary access links without encoding overhead.
  • Convert existing UUIDs to compact base64url strings for cleaner display in URLs or user-facing interfaces.
  • Replace py-nanoid in existing projects where performance is a bottleneck in ID generation loops.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates unique, URL-friendly string IDs using a Rust-backed implementation that is faster than the original py-nanoid library.

Yes, if you need fast, URL-friendly ID generation and are comfortable with compiled dependencies. The library is stable, permissively licensed, and actively maintained. Install friction is moderate due to Rust bindings, but wheels are widely available. Not necessary if you already use py-nanoid and performance is not a concern, or if you prefer pure-Python solutions.

Install

fastnanoid on PyPI

pip

pip install fastnanoid

uv

uv add fastnanoid

poetry

poetry add fastnanoid

Installing fastnanoid

Before you install

Medium install friction due to compiled Rust bindings, but wheels are available for Python 3.8–3.13 across multiple platforms (Linux, macOS, Windows, and ARM architectures). Last release was 410 days ago; the repository is active but aging.

License in practice

Licensed under MIT (permissive), which allows commercial and private use with minimal restrictions.

Quickstart

pip install fastnanoid
from fastnanoid import generate
id_string = generate()

Requires Python 3.8 or later; compiled wheels must match your Python version and platform.

Verify before relying

  • Whether the 2.8x speed claim versus py-nanoid holds across real-world workloads and ID lengths.
  • How collision probability compares to standard nanoid implementations for production use cases.
  • Whether the uuid conversion helpers (uuid_to_urlid, urlid_to_uuid) are stable and widely tested.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 410 days since the last release
Last repo commit
First released
Downloads 155,572/month — #10,808 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fastnanoid-0.4.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fastnanoid-0.4.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; fastnanoid-0.4.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; fastnanoid-0.4.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; fastnanoid-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fastnanoid-0.4.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; fastnanoid-0.4.3-cp310-cp310-musllinux_1_2_aarch64.whl; fastnanoid-0.4.3-cp310-cp310-musllinux_1_2_armv7l.whl; fastnanoid-0.4.3-cp310-cp310-musllinux_1_2_i686.whl; fastnanoid-0.4.3-cp310-cp310-musllinux_1_2_x86_64.whl; fastnanoid-0.4.3-cp310-cp310-win32.whl; fastnanoid-0.4.3-cp310-cp310-win_amd64.whl; fastnanoid-0.4.3-cp311-cp311-macosx_10_12_x86_64.whl; fastnanoid-0.4.3-cp311-cp311-macosx_11_0_arm64.whl; fastnanoid-0.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fastnanoid-0.4.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; fastnanoid-0.4.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; fastnanoid-0.4.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl; fastnanoid-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fastnanoid-0.4.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl

Keywords: nanoid

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: RustTyping :: Typed

Tags

unique id generator pythonnanoid alternativeurl-friendly string idsfast uuid replacementsecure random id generationrust-backed id libraryshort unique identifiers
id-generationrust-backedurl-safe

More Software Development packages