A package containing various helper functions to generate unique identifier strings
npm install @stryke/unique-id
This package is part of Storm Software's 💥 Stryke monorepo. Stryke packages TypeScript utility packages with shared functionality common to many Storm Software applications.
  !semantic-release !GitHub Workflow Status (with event)
> [!IMPORTANT] Important
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
A package containing various helper functions to generate unique identifier
strings.
This package includes generator functions for the following type of identifiers:
| Identifier | Description | Details |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Snowflake Identifier | Snowflakes are 64 bits in binary. (Only 63 are used to fit in a signed integer.) The first 41 bits are a timestamp, representing milliseconds since the chosen epoch. The next 10 bits represent a machine ID, preventing clashes. Twelve more bits represent a per-machine sequence number, to allow creation of multiple snowflakes in the same millisecond. The final number is generally serialized in decimal. |
| Universally Unique Identifier (UUID) | A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. The term globally unique identifier (GUID) is also used, typically in software created by Microsoft. When generated according to the standard methods, UUIDs are for practical purposes unique. Their uniqueness does not depend on a central registration authority or coordination between the parties generating them, unlike most other numbering schemes. |
| Customer User Identifier (CUID) | Collision-resistant IDs optimized for horizontal scaling and performance. |
| Nano ID | A tiny (124 bytes), secure, URL-friendly, unique string ID generator for JavaScript |
- Installing
- Reduced Package Size
- Development
- Building
- Running unit tests
- Linting
- Storm Workspaces
- Roadmap
- Support
- License
- Changelog
- Contributing
- Contributors
Using pnpm:
``bash`
pnpm add -D @stryke/unique-id
Using npm
`bash`
npm install -D @stryke/unique-id
Using yarn
`bash`
yarn add -D @stryke/unique-id
This project uses tsdown to package the source code due to
its ability to remove unused code and ship smaller javascript files thanks to
code splitting. This helps to greatly reduce the size of the package and to make
it easier to use in other projects.
This project is built using Nx. As a result, many of the usual
commands are available to assist in development.
Run nx build unique-id to build the library.
Run nx test unique-id to execute the unit tests via Jest.
Run nx lint unique-id` to run ESLint on the package.
Storm workspaces are built using
Nx, a set of extensible dev tools
for monorepos, which helps you develop like Google, Facebook, and Microsoft.
Building on top of Nx, the Open System provides a set of tools and patterns that
help you scale your monorepo to many teams while keeping the codebase
maintainable.
See the open issues for a
list of proposed features (and known issues).
- Top Feature Requests
(Add your votes using the 👍 reaction)
- Top Bugs
(Add your votes using the 👍 reaction)
- Newest Bugs
Reach out to the maintainer at one of the following places:
- Contact
- GitHub discussions
-
This project is licensed under the Apache License 2.0. Feel free to edit and
distribute this template as you like.
See LICENSE for more information.
This project adheres to
Semantic Versioning. Every release, along
with the migration instructions, is documented in the CHANGELOG
file
First off, thanks for taking the time to contribute! Contributions are what
makes the open-source community such an amazing place to learn, inspire, and
create. Any contributions you make will benefit everybody else and are **greatly
appreciated**.
Please try to create bug reports that are:
- _Reproducible._ Include steps to reproduce the problem.
- _Specific._ Include as much detail as possible: which version, what
environment, etc.
- _Unique._ Do not duplicate existing opened issues.
- _Scoped to a Single Bug._ One bug per report.
Please adhere to this project's code of conduct.
You can use
markdownlint-cli to
check for common markdown style inconsistency.
Thanks goes to these wonderful people
(emoji key):
Patrick Sullivan 🎨 💻 🔧 📖 ⚠️ | Tyler Benning 🎨 | Stormie 🚧 | ||||
Add your contributions | ||||||
This project follows the
all-contributors
specification. Contributions of any kind welcome!

Storm Software is an open source software development organization and creator
of Acidic, StormStack and StormCloud.
Our mission is to make software development more accessible. Our ideal future is
one where anyone can create software without years of prior development
experience serving as a barrier to entry. We hope to achieve this via LLMs,
Generative AI, and intuitive, high-level data modeling/programming languages.
Join us on Discord to chat with the team,
receive release notifications, ask questions, and get involved.
If this sounds interesting, and you would like to help us in creating the next
generation of development tools, please reach out on our
website or join our
Slack channel!