Skip to main content

Crate nexcore_id

Crate nexcore_id 

Source
Expand description

Zero-dependency UUID implementation for nexcore ecosystem

Provides NexId — a 128-bit universally unique identifier compatible with UUID v4 (random) and v7 (timestamp + random) specifications.

§Supply Chain Sovereignty

This crate has zero external dependencies. It replaces the uuid crate for the nexcore ecosystem, eliminating supply chain risk for identifier generation.

§Security

Platform-dependent entropy quality:

PlatformEntropy SourceCSPRNG
Unix (Linux, macOS, BSD)/dev/urandomYes
Windows (Vista+)BCryptGenRandomYes
WASMTimestamp + xorshiftNo
OtherTimestamp + xorshiftNo

WARNING: On WASM and unsupported platforms, UUIDs are generated using a timestamp-seeded xorshift64 PRNG that is NOT cryptographically secure. Do not use for:

  • Cryptographic keys or secrets
  • Password reset tokens
  • Security-sensitive session identifiers

See SECURITY.md for full threat model and usage guidelines.

§Examples

use nexcore_id::NexId;

// Generate random v4 UUID
let id = NexId::v4();
println!("{id}"); // e.g., "550e8400-e29b-41d4-a716-446655440000"

// Generate timestamp-based v7 UUID
let id = NexId::v7();

// Parse from string
let id: NexId = "550e8400-e29b-41d4-a716-446655440000".parse().unwrap();

Structs§

NexId
A 128-bit universally unique identifier.

Enums§

ParseError
Error returned when parsing a UUID string fails.