A tiny (190B) and extremely fast utility to generate random hexadecimal IDs of fixed length.
Hexoid is a lightweight JavaScript utility that generates random hexadecimal IDs of a fixed length. It solves the need for fast, predictable, and compact unique identifiers in non-cryptographic scenarios, such as generating session IDs, temporary keys, or object references. The library emphasizes performance and minimal bundle size over cryptographic security.
Developers building web applications, Node.js services, or tools that require high-performance unique ID generation without cryptographic guarantees. It's particularly useful for those optimizing bundle size or speed in performance-sensitive environments.
Developers choose Hexoid for its exceptional speed—benchmarks show it's up to 20x faster than alternatives—and its tiny 190-byte footprint. It offers a simple, focused API for generating fixed-length hexadecimal IDs, making it ideal when security isn't a concern but performance and size are critical.
A tiny (190B) and extremely fast utility to generate random IDs of fixed length
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show hexoid generates over 80 million IDs per second, up to 20x faster than alternatives like nanoid and uid, making it ideal for high-throughput scenarios.
At only 190 bytes minified and gzipped, it adds negligible overhead, perfect for browser and Node.js projects where bundle optimization is key.
IDs end in incremental values (e.g., '...da00', '...da01'), providing deterministic output useful for debugging and logging traceability.
Available as both CommonJS and ES Module, ensuring easy integration across different JavaScript environments without compatibility issues.
The README explicitly states it's not a CSPRNG, making it unsafe for security-sensitive use cases like session IDs or tokens, a significant limitation.
Restricted to lowercase hexadecimal pairs, which may not satisfy requirements for IDs needing alphanumeric diversity or symbol inclusion.
Users must manually calculate and manage collision probabilities using the provided formula, adding overhead for large-scale deployments despite the fixed length.