test-uuid-generator
v1.0.0
Published
A simple UUID generator using crypto
Downloads
9
Readme
UUID Generator
A lightweight, cryptographically secure UUID (v4) generator for Node.js and browsers.
Features
- 🔒 Uses
crypto.randomBytesfor true randomness - 🚀 Lightweight and fast
- 📦 Zero dependencies
- 🌐 Works in Node.js and modern browsers
- 📘 Written in TypeScript with type definitions included
Installation
npm install test-uuid-generatoror
yarn add test-uuid-generatorUsage
import { generateUUID } from 'test-uuid-generator';
const uuid = generateUUID();
console.log(uuid); // e.g., "f47ac10b-58cc-4372-a567-0e02b2c3d479"API
generateUUID(): string
Generates a random UUID v4.
Returns: A string representing the generated UUID.
Why Use This Package?
- Simplicity: One function call to generate a UUID.
- Security: Uses cryptographically strong random values.
- Lightweight: Minimal code, no external dependencies.
- Type-safe: Written in TypeScript with included type definitions.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
Support
If you encounter any problems or have any questions, please open an issue in the GitHub repository.
Made with ❤️ by Badar Usman
