
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
react-native-uuid
Advanced tools
react-native-uuid is a zero-dependency TypeScript implementation of RFC4122.
react-native-uuid is a zero-dependency TypeScript implementation of RFC4122 standard A Universally Unique IDentifier (UUID) URN Namespace. Please note, this library uses pseudo random generator based on top of Math.random. New version with hardware support is WIP.
Heavily inspired by:
Huge thanks to Randy Coulman for the early version of a code.
npm install react-native-uuid
import uuid from 'react-native-uuid';
uuid.v4(); // ⇨ '11edc52b-2918-4d71-9058-f7285e29d894'
# Install dependencies
npm install
# Run tests
npm test
npm test -- --watch # Watch mode
npm test -- --coverage # With coverage report
# Linting and formatting
npm run lint # Lint TypeScript and JavaScript
npm run prettier:write # Format all files
npm run prettier:check # Check formatting without changes
# Building
npm run build # Build TypeScript to JavaScript
npm run prepublishOnly # Build before publishing (auto on npm publish)
# Benchmarking
npm run bench:rn # Generate benchmark matrix for RN 0.71 - 0.77
npm run bench:security # Run security benchmark with pass/fail thresholds
# Documentation
npm run docs # Generate TypeDoc documentation
We keep a baseline benchmark matrix for major React Native versions:
v1, v3, v4, v5, validate, parse, unparsebenchmarks/results/rn-version-benchmark.mdbenchmarks/results/rn-version-benchmark.jsonbenchmarks/results/test-results.jsonGenerate fresh results locally:
npm run bench:rn
npm test -- --runInBand --json --outputFile benchmarks/results/test-results.json
npm run bench:security
npm run bench:figures
The security benchmark is designed as a pass/fail gate for randomness quality and misuse safety checks.
npm run bench:securitybenchmarks/results/security-benchmark.mdbenchmarks/results/security-benchmark.json.github/workflows/security-benchmark.ymlCurrent threshold gates:
00<= 4<= 4<= 4200The CI job fails if any threshold is exceeded.
Methods documentation is available here
Previous version has been based on randombytes that is not compatible with react-native out of the box.
Please submit an issue if you found a bug.
See the contributing guide to learn how to contribute to the repository and the development workflow.
Thank you to our sponsors:
Copyright (c) 2016-2026 Eugene Hauptmann
The uuid package is a popular library for generating UUIDs in JavaScript. It supports the same versions of UUIDs (v1, v4, and v5) and is widely used in both Node.js and browser environments. Compared to react-native-uuid, it is more general-purpose and not specifically tailored for React Native.
Nanoid is a small, secure, URL-friendly unique string ID generator for JavaScript. It is much smaller in size compared to uuid and react-native-uuid, making it a good choice for performance-sensitive applications. However, it does not generate standard UUIDs, which might be a limitation for some use cases.
Shortid is a concise, non-sequential, URL-friendly unique ID generator. It is designed to be shorter than UUIDs and is useful for cases where a smaller ID is sufficient. However, it is not as widely adopted as uuid or react-native-uuid and does not follow the UUID standard.
FAQs
react-native-uuid is a zero-dependency TypeScript implementation of RFC4122.
The npm package react-native-uuid receives a total of 381,016 weekly downloads. As such, react-native-uuid popularity was classified as popular.
We found that react-native-uuid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.