1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! Collision-resistant local-volume ID generation.
//!
//! Consolidates the copy-pasted `rand_xor` / `new_id` pattern that appears
//! independently in nido-photo-svc, nido-calendar-svc, nido-notifications-svc,
//! nido-voice-svc, nido-location-svc, nido-journal-svc, nido-sync-svc,
//! nido-handoff-svc (8 copies).
use ;
/// Generate a collision-resistant local-volume ID.
///
/// Uses xorshift64 seeded from the current nanosecond timestamp XOR-ed with a
/// stack-variable address. NOT cryptographically random — replace with
/// `uuid::Uuid::new_v4()` when uuid joins `workspace.dependencies`.
///
/// Format: `nido-<16 lowercase hex digits>`
/// Generate a random `u32` using xorshift32 seeded from a stack address.
///
/// Suitable for short service-local IDs where cryptographic strength is not
/// required. Used by per-service `new_id()` helpers before they migrate to
/// `rand_id()`.
// ── Internals ────────────────────────────────────────────────────────────────