Random & UUID
Random number generation, UUID and utility tools
Random number generation and UUID creation are critical for security and uniqueness. Cryptographically secure random numbers are used in encryption keys, session tokens, and security protocols. UUID (Universally Unique Identifier) is used to create unique identities across systems. To make a simple analogy, random numbers are like a safe's password - they must be unpredictable. CSPRNG is mandatory for cryptographic randomness; use `os.urandom`/`getrandom`/`CryptGenRandom` etc.
Use Cases
- Encryption key generation
- Session tokens
- Unique ID creation
- Database primary keys
- Security protocols
- Test data generation
- Cryptographic security
- Uniqueness guarantee
- Unpredictability
- High entropy
- Standard compliance
| Algorithm | Security | Speed | Use Cases |
|---|---|---|---|
| Random (CSPRNG) | Very High | Very Fast | Encryption keysSalt generationNonce creation |
| UUID v4 | Very High | Very Fast | Unique ID creationDatabase primary keysAPI tokensCSPRNG required |
| UUID v1 | Low | Very Fast | Privacy risk, predictableNot recommendedContains timestamp and MAC |
* Comparisons are relative to reference/hardware acceleration on 64-bit CPU
Random Number Generation
Cryptographically secure random number generation. CSPRNG is mandatory; use `os.urandom`/`getrandom`/`CryptGenRandom` etc.
UUID (Universally Unique Identifiers)
Universally unique identifiers. CSPRNG required for UUID v4.
Tools and Utilities
Utility tools for networking and identification.
- • RFC 4122
- • NIST SP 800-90A